Recording capabilities are a very useful functionality of any test automation tool. Although just recording and playing back your test will not work for any larger scale test automation project this functionality is still very useful for exploration and investigative purposes. Also, it helps in many cases when you just don’t want to type a whole lot of code when the tool can generate it automatically for you. I would recommend, however, especially if you are just starting to learn coding and programming, typing all your code by hand, rather than doing copy-paste.
In this reference, we mostly going to use Visual Studio with Selenium WebDriver components to code our scripts (create scripts programmatically) but it would also be useful to use a recorder to record a script on a browser to see and understand how Selenium recognizes browser objects and what kind of code it generates so for that we need a browser recording tool. Below are a few options available at this point.
Firefox Browser + Selenium IDE (Firefox Add-on)
NOTE: Selenium IDE Firefox Add-On allows recording of user actions on Firefox browser. If you’d like to try this feature please note that the latest version of Firefox browser (v57.04) at the time of this reference is not compatible with the Selenium IDE Add-on. According to Official Selenium Blog at https://seleniumhq.wordpress.com/2017/08/09/firefox-55-and-selenium-ide/, “from Firefox 55 onwards, Selenium IDE will no longer work”.
To deal with Firefox and Selenium IDE compatibility limitation you can download and install earlier version of Firefox (v 54.0) and disable automatic updates in Firefox -> Preferences -> Advanced -> Update -> Select: “Never check for updates…” option, otherwise Firefox will update automatically (if the first option is selected) or will keep prompting to install the updates if the second option is selected.
Katalon Automation Recorder an alternative to Selenium IDE
Another option is an alternative to Selenium IDE recorder Katalon Automation Recorder that you can install for both Chrome and Firefox browsers. According to Katalon Studio Website, Katalon Automation Recorder “is the Selenium IDE-compatible replacement on latest Chrome and Firefox that helps record, play, debug, manage automated tests, and export to C#, Java, Ruby, Python, etc.”
Recording an Automated Script using Browser Automation recorder
Once you have Browser Automation Recorder of your choice installed (you should see an icon in your browser toolbar) go ahead start it up, click record and record a basic script similar to this:
- Open http://www.google.com
- In the search box type a keyword, i.e Katalon Studio, and press submit button
- Click the first search result on the search results page
- Click the link on the first page
- Verify page Title
- Right-click on the page element you want to verify and select VerifyText from the menu
Export the recording to another language/framework
Click Export button and select a language from a Language & Framework drop down list to export the recording to language of your choice.