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:
  1. Download and install the Katalon Recorder extension in either Chrome or Firefox.
  2. In the Katalon Recorder, select
    New
    to create a test case within a test suite.
  3. Select
    Record
    to start recording the script. The Katalon Recorder disappears and starts recording your steps in the browser.
  4. Select
    Stop
    to stop recording the script. The test steps appear in an ordered list.
  5. To edit the test steps, select the
    Add
    ,
    Delete
    ,
    Copy
    , or
    Paste
    icons. You can also edit the command, target, and value of an individual test step.
  6. To test the script, select
    Play
    . 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.
  7. Select
    Export
    to 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.
  8. To upload the XML file to a WebDriver Monitor, open the WebDriver Monitor and select the
    General
    tab select. Select
    Browse
    on the
    Upload a valid WebDriver script
    field 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:
  • Command
    Indicates the action, such as click, double click, open, and refresh
  • Target
    Represents the target element in the UI, for example, a field, link, or menu.
  • Value
    Specifies 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.
Solution
Browser 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.