Reputation: 1639
I am using Jmeter webdriver sampler with chrome-browser. I need to use chromeoption and desire capability in jmeter. How to I code to use those options.
example code which I want to use can be this.
ChromeOptions options = new ChromeOptions();
options.addArguments(new String[] {"window-size=12000,10000"});
DesiredCapabilities cap = DesiredCapabilities.chrome();
cap.setCapability(ChromeOptions.CAPABILITY, options);
Can someone help in this.
Upvotes: 1
Views: 2844
Reputation: 58774
You can use the following sample taken from selenium closed issue
options.ChromeOptions options = new ChromeOptions(); options.AddArgument("--start-maximized"); // You can cast the ICapabilities object returned by ToCapabilities() // as DesiredCapabilities. Future .NET bindings releases will likely // have a copy constructor for this, but this will do for now. DesiredCapabilities caps = options.ToCapabilities() as DesiredCapabilities; caps.SetCapability("platform", "VISTA"); caps.SetCapability("version", "{whatever}""; IWebDriver driver = new RemoteWebDriver(new Uri("{grid location}",
Upvotes: 0
Reputation: 167992
Looking into ChromeDriverConfig.java it isn't something you can currently control with the WebDriver Sampler so the options are in:
ChromeDriverConfig
source code and amend initialization of the ChromeOptions and DesiredCapabilities according to your needs. Once done you will need to re-build the plugin and put it to "lib/ext" folder of your JMeter installation. Upvotes: 2