WebDriver CLI

WebDriver CLI is a command-line tool to execute Selenese XML scripts on a desktop PC, using a locally installed web browser. The WebDriver agent allows you to test and fine-tune the scripts before uploading them to
DX APP Synthetic Monitor
.
Prerequisites
Ensure that you have one of the following application as minimum requirements from each category:
Operating System
Java 8 JRE
Web Browser
Automation interface
Import SSL Certificate
1
  • Linux
  • Windows
  • Mac
  • Oracle
  • OpenJDK
  • Zulu
  • Chrome 72.0+
  • Firefox 65.0+
  • Internet Explorer 11.x
  • ChromeDriver
  • geckodriver
  • Internet Explorer Driver Server
  1. The WebDriver agent decrypts SSL communication with the tested website. To do that, it presents the browser with a certificate signed by an untrusted certificate authority. To prevent errors, import the SSL Certificate to your browser.
Install the WebDriver Agent
This section lists the installation steps for the WebDriver agent.
  1. Install one of the following Java 8 JRE:
  2. Install your desired web browser and the automation interface.
    1. Perform the following steps to run scripts on Chrome:
    2. Perform the following steps to run scripts on Firefox:
    3. Run the InternetExplorerDriver to start the driver on Internet Explorer.
  3. Download the web driver agent xx.x.x JAR to a temporary directory to run it from the command line.
Using the WebDriver Agent
Use the following command syntax to run the WebDriver Agent.
java -jar webdriver-agent-xx.x.x.jar -b (chrome|firefox|ie) [-s] input.xml [custom.properties]
  • -b
    : select browser to use for the test run
  • -s
    : enable step-over mode
  • input.xml
    : path to a Selenese XML script
  • custom.properties
    : specify the path to a file with configuration properties
  • (Optional)
    Step-over mode
    If the
    -s
    option is specified, the tool pauses the script at each command. The script prompts you to press any key to continue executing the command.
Output
After the script executes, the tool creates the following files in the working directory:
  • result.json
    - Detailed result of the test run.
  • output.0.har
    - Log of HTTP transactions in HAR format. Use the viewer service to view  the output as a waterfall chart
Configure the WebDriver Agent
The WebDriver agent has the following configuration options
  • implicitWait
    : Default 30; time in seconds to wait for an element to appear in DOM. For more information, see Implicit Wait.
  • waitTimeout
    : Default 30;  time in seconds to wait on Selenese wait* commands
  • logLevel
    : Default FINEST; verbosity of log output. One of
    SEVERE
    ,
    WARNING
    ,
    INFO
    ,
    CONFIG
    ,
    FINE
    ,
    FINER
    ,
    FINEST
    .
  • quiescenceTime
    :
    Disabled by default. Experimental; Keep the test running until there are no active HTTP transactions for a given period of time. In milliseconds.
  • monitorTimeout
    : Disabled by default. Ignored in step-over mode. The maximum amount of time in seconds the test is allowed to run for.
  • monitorDenyRequests
    : regex or comma-separated list of domains to block.
  • monitorAllowRequests
    : regex or comma-separated list of domains to allow.
  • monitorUser
    : Username for basic authentication or script
    {username}
    placeholder.
  • monitorPassword
    : Password for basic authentication or script
    {password}
    placeholder.
  • monitorUserAgent
    : Override browser user agent header.
  • monitorParameters
    : Script parameters. Format is
    parameter_1
    =
    value_1
    &
    parameter_2
    =
    value_2
    &...
    parameter_n
    =
    value_n
  • monitorUseProxy
    : Linux only. If set to
    true
    , use proxy server configured in
    /etc/apt/apt.conf
    or
    /etc/yum.conf