The Selenium plugin is designed to be able to start/stop the Selenium Server from within Clarive. Selenium Server should be on a Unix machine.
Selenium is a test automation tool for handling browsers for testing web applications.
To install the plugin, place the cla-selenium-plugin
folder inside $CLARIVE_BASE/plugins
directory in the Clarive instance.
To configurate the Selenium Server Resource open:
In Clarive SE: Resources -> ClariveSE.
In Clarive EE: Resources -> Selenium.
This Resource is for saving your Selenium Server settings:
- Server - This is the Selenium hostname.
- Path - Full path to Selenium Server jar file.
- Port - The Selenium Server port. The default is
4444
. - Session timeout - Specifies the timeout before the server automatically kills
a session that has had no activity in the last X seconds. The default is
1800
.
X-Framebuffer options:
- Enabled - This option should be checked if you want run Selenium tests with Xvfb (X virtual framebuffer).
- Command - Command for running Xvfb. The default command is:
export DISPLAY=:10;Xvfb :10 -ac
Example:
Server: Resource-server
Path: /home/selenium/selenium-server.jar
Port: 4444
Session timeout: 1800
Enabled: True
Command: export DISPLAY=:10;Xvfb :10 -ac
This service will start the Selenium Server that you select from SeleniumServer Resource.
The various parameters are:
- Selenium Server (variable name: server) - You only need to select the Selenium Server Resource you want to start from Clarive.
This service will stop the Selenium Server that you select from SeleniumServer Resource.
The various parameters are:
- Selenium Server (server) - You only need to select the Selenium Server Resource you want to stop from Clarive.
It is recommended that you use the service in the step POST in your deployment.
Once the plugin is placed in its folder, you can find this service in the palette in the section of generic service and can be used like any other palette op.
Start/Stop example:
Selenium Server: Selenium server
Or using vars:
Selenium Server: ${selenium-server}
If you want to use the plugin through the Rulebook, in any do
block, use this ops as examples to configure the different parameters:
Start example:
do:
- selenium_start:
server: 'selenium_resource' # Required. Use the mid set to the resource you created
Stop example:
do:
- selenium_stop:
server: 'selenium_resource' # Required. Use the mid set to the resource you created
The service will return the response from the console output.
Task failed
You will get the error from the console output.
Variable required
Error in rulebook (compile): Required argument(s) missing for op "selenium_stop": "server"
Make sure you have all required variables defined.
Not allowed variable
Error in rulebook (compile): Argument `Server` not available for op "selenium_start"
Make sure you are using the correct paramaters (make sure you are writing the variable names correctly).
Feel free to join Clarive Community to resolve any of your doubts.