Switching from local to remote driver
When switching from local to remote testing on the fly, users need an easy way to change the test to the required platforms. As we mentioned when building the setDriver
method, it takes parameters for browser (or mobile device), platform, and environment.
In order to change these parameters, users can either set them in a TestNG suite XML file or a JVM argument using the -D
switch. We covered that previously, but let's go over the rules of precedence again.
Suite parameters
The following parameters override the default settings for the browser, platform, and environment:
// suite xml file <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="My_Test_Suite" preserve-order="true" parallel="false" thread-count="1" verbose="2"> <test name="My Test"> <parameter name="browser" value="chrome" /> <parameter name="platform" value="Linux" /> <parameter...