The SeleniumLibrary doesn't have the capability to run the same command against multiple browsers. The feature does sound quite cool, but will require quite some modifications in it (all revolving around relaying the same command to all browsers), and taking care of any unforeseen circumstances in its current architecture (what should happen if one of the selenium drivers loses connectivity, but the others are working ok? etc).
The usual approach for multi-browser testing is to run the collection of cases, one by one, against each browser. Thus a full coverage matrix will be produced - the run on one browser doesn't affect the run on another.
A very basic sample how to do it - code with inline comments:
*** Settings ***
Documentation A suite of cases.
Library SeleniumLibrary
# the browser will be opened in the start-up of the suite
Suite Setup Open Browser url=https://www.google.com browser=${browser} # which browser? the one that's the value of the variable
Suite Teardown Close Browser # and closed when the suite finishes
*** Variables ***
# the variable will hold the name of the target browser
${browser} Chrome # a default value, if not overriden
*** Test Cases ***
Test this
[Documentation] Do this then that and verify the thing.
Go To https://www.yahoo.com
My Keyword 1
My Keyword 2
Verify That
[Documentation] Another case
My Keyword Doing Thing with argument
Log log message
So - the actual browser to use is the value of the ${browser}
variable. If it's not overridden, it has a default value (Chrome in that case).
And now, to run with a different browser you just set it its name, on the CLI for starting a run; sample:
robot --variable browser:Firefox suites\sample.robot
The argument --variable
is used to set the value of one; it is given in the format var_name:value
. This btw is described in details in the user guide, the Variables section.
Thus you can start one run with Chrome, another with Firefox, and so on.
A small tip - by default, the run logs are in files with the names "output.xml", "log.html" and "report.html". If you start 3 runs with 3 different browsers, and don't bother copying the files, they will be overwritten. It's better to define a custom name for each, for easier processing. This is done with these 3 arguments - --output
, --log
and --report
; for example:
robot --variable browser:Edge --output output-edge.xml --log log-edge.html --report report-edge.html suites\sample.robot
P.S. I do realize you're using RF in jython, but I don't have this environment, thus vanilla standalone RF - you can adjust the CLI examples and the library import with the help of the user guide.
Open Browser
has as an argument the browser name; so in one run you will pass "Chrome", then in the following - change it to "Firefox", and so on. – Todor Minakov