Child pages
  • Setting Up Selenium for Web Client UI Testing

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • If Selenium and Servoy Web Client are configured, then the solution can be run on Web Client with Firefox browser.
  • When the application is running on browser, then the Selenium can be started using CTRL+ALT+S or going to Firefox > Web Developer > Selenium IDE.

Recording with Selenium IDE

 

Selenium IDE records the events generated by the user in a Test Case as Selenium commands (clicks/ typing/ keyboard events..).. Each command is targeting a specific element of the DOM (The HTML tree generated by the rendering of the Web Client) using the default Locator Builder; the default is the wicketpath locator if it has been correctly placed on top of the Locator Buillder list.

Just recording is not enough for a correct playback of the Test Case. To validate the test should be added UI verification checks. Is the element present after i have clicked the button ? is the result value equal to the expected value ?
When recording Selenium IDE assumes that all the elements are already present in the DOM but this is not always the case. Selenium IDE is asynchronous therefore is necessary to add an explicit command to put Selenium waiting until the result of the triggered action is received. For example a click on the button 'next record' result in showing the next record of the foundset. The result of the action is not immediate therefore the expected value cannot be immediately target with Selenium. Selenium should wait until the result of the click action is complete before targeting the values of the next record. Use the commands waitFor to wait a specific element or a specific value to be loaded on the page.


Recording Events

  • Click record button
  • Go to WC, do the actions needed, typing data / adding records / delete
  • When done go to selenium and hit Stop recording button
  • A sequence is created which can be saved using CTRL+S

...

Tip: for more detailed documentation and video tutorials user this link: http://jroller.com/selenium/

Plugins and add-on for Selenium IDE.

Many plugins are available for Selenium IDE as Firefox add-on.

SelBlock

Install the Firefox Extension https://addons.mozilla.org/en-US/firefox/addon/selenium-ide-sel-blocks/. Provides javascript-like conditionals, looping, callable functions, error catching, and JSON/XML driven parametrization to perfom Data Driven tests.

 

Implicit Wait

Install the Firefox Extension https://addons.mozilla.org/en-US/firefox/addon/selenium-ide-implicit-wait/?src=search. Allows Selenium IDE to automatically wait until the element is found before executing each command using a locator. To use it add the command setImplicitWaitCondition  at the beginning of each Test Case.

File Logging

Install the Firefox Extension FileLogging: https://addons.mozilla.org/en-US/firefox/addon/file-logging-selenium-ide/?src=search Log the test results of the Selenium IDE into a file. Append text to existing log. does never delete the log file. Use Advanced text editor to view results. Is possible to add a timestamp to any log.

Setup Log extension: Open the Selenium IDE, go to menu  Options -> Options -> File Logging.
Select the log file and log level. Default Info