January 2018
Beginner to intermediate
354 pages
7h 59m
English
Finally, the next example shows how to set the optional browser preferences as a JVM argument using the TestNG parameter attribute in the suite XML file:
// pass in the key:value pairs as a runtime argument-Dbrowserprefs=applicationCacheEnabled:false, network.cookie.cookieBehavior:0// pass in the key:value pairs as a TestNG XML parameter<test name="Selenium TestNG Test Suite"> <parameter name="browser" value="chrome" /> <parameter name="platform" value="Windows 10" /> <parameter name="browserPrefs" value="intl.accept_languages:fr" /> <classes> <class name="com.myproject.MyTest" /> </classes></test>
// for convenience, create a setPreferences method// to build the map to pass into the driverpublic Map<String, Object> ...
Read now
Unlock full access