Build WebDriver Scripts
Build WebDriver Scripts
WebDriver Monitors run selenium XML scripts and collect results for real browser monitoring. You can manually create custom scripts or use the following tools:
Use Katalon Recorder to Create Scripts
The Katalon Recorder is a free browser extension that records browser activity in the selenium XML format. After you record, edit and test the script, you export the XML file and import the file into a WebDriver Monitor.
Follow these steps:
- Download and install the Katalon Recorder extension in either Chrome or Firefox.
- In the Katalon Recorder, selectNewto create a test case within a test suite.
- SelectRecordto start recording the script. The Katalon Recorder disappears and starts recording your steps in the browser.
- SelectStopto stop recording the script. The test steps appear in an ordered list.
- To edit the test steps, select theAdd,Delete,Copy, orPasteicons. You can also edit the command, target, and value of an individual test step.
- To test the script, selectPlay. Katalon runs the script in the browser window.To prevent browser data from interfering with the script, run the script in incognito (private) mode. WebDriver Monitor runs the XML scripts in incognito (private) mode.
- SelectExportto save the final script to a human-readable XML format.You cannot re-import the XML file back to the Katalon Recorder. Instead, save the Test Suite as an HTML file for future editing.
- To upload the XML file to a WebDriver Monitor, open the WebDriver Monitor and select theGeneraltab select. SelectBrowseon theUpload a valid WebDriver scriptfield to find the XML file.
You recorded a script and uploaded an XML file to a WebDriver Monitor. For more information, see WebDriver Monitor.
Edit Selenium XMLYou can manually edit Selenium-based XML. Selenium Syntax contains three parameters:
- CommandIndicates the action, such as click, double click, open, and refresh
- TargetRepresents the target element in the UI, for example, a field, link, or menu.
- ValueSpecifies the value being selected or entered.
Example: Open Gmail Account
<selenese> <command>open</command> <target><![CDATA[https://mail.google.com/mail/u/0/#inbox]]></target> <value><![CDATA]></value></selenese> </selenese>
Supported Selenium Commands
For the list of supported Selenium commands for WebDriver Monitor, see Supported Selenium Commands.
For more information about Selenium command parameters, see Selenese (Selenium IDE) Commands Reference.
Troubleshoot RBM Scripts
The RBM Script Runs Successfully in Katalon but Fails in WebDriver Monitor
Symptom:The RBM script runs in Katalon Recorder without errors. After importing the XML file of the script to the WebDriver Monitor, the script fails due to elements not loading.
Solution:By default, the Katalon Recorder runs the recorded scripts in one cycle and does not pause for elements to load. Use
WaitFor<element>commands in the script to pause for the necessary elements.
Also, see WebDriver CLI.
Testing a Script in Katalon Fails
Symptom:An RBM script fails in Katalon.
SolutionBrowser data can affect the: initial test in the Katalon Recorder. Use the incognito (private) mode to test the script in Katalon.
Error Message in WebDriver Monitor
Symptom:The following message appears after a WebDriver Monitor runs a script: '
Command not specified'.
Solution:The WebDriver Monitor may not support a Selenium command in the script. For more information about supported Selenium commands, see Supported Selenium Commands.