How to add chromeoptions in Jmeter Chrome Webdriver

491 views
Skip to first unread message

Vaishali Bhargava

unread,
Feb 21, 2018, 1:51:17 AM2/21/18
to jmeter-plugins
I need to add chrome options to the chrome driver as below in Jmeter Chrome Webdriver -

ChromeOptions opts = new ChromeOptions();
opts.addArguments("allow-file-access-from-files");
    opts.addArguments("use-fake-ui-for-media-stream");
    opts.addArguments("allow-file-access");
    opts.addArguments("use-fake-device-for-media-stream");
    opts.addArguments("disable-popup-blocking");


Please suggest , how to do this?

oros...@gmail.com

unread,
Apr 17, 2018, 9:28:29 AM4/17/18
to jmeter-plugins
+1. Would love to achieve the same.

avam0...@gmail.com

unread,
May 7, 2018, 7:00:50 AM5/7/18
to jmeter-plugins
Not exactly what you've been asking for, just food for thoughts.
This is how I managed to disable image loading in chrome WDS test running under Jmeter:

-------------------------------
// Chrome magic to disable image loading, speeds-up the page loading over network, 
// somewhat lowering the CPU load on browser side.
// Goes directly to Chrome's settings page, where Chrome set focus in search input box. 
// Does TAB TAB ENTER to turn the lever from "Show all (recommended)" to "Do not show any images" position.
// Doing it "the right way", by clicking the lever by it's element locator does not work on settings page.
// Note that this should be done before calling "WDS.sampleResult.sampleStart()", 
// as the time spent in settings page is not related to sample execution time

WDS.browser.get('chrome://settings/content/images') 
sleeper.sleep(quartersec)
WDS.browser.switchTo().activeElement().sendKeys('\uE004\uE004\uE007');
--------------------------------------

Snigdha Narain

unread,
Nov 24, 2020, 6:50:17 AM11/24/20
to jmeter-plugins
Please help even i want to know how add below in jmeter WebDriver Sampler
ChromeOptions options = new ChromeOptions(); options.addArguments("use-fake-ui-for-media-stream");

Dmitri Tikhanski

unread,
Nov 24, 2020, 9:40:48 AM11/24/20
to jmeter-plugins
Unfortunately WebDriver Sampler doesn't provide the way of manipulating the ChromeOptions, you either need to add the options you want under ChromeDriverConfig.java, after that you will need to re-build the plugin and copy the .jar to "lib/ext" folder of your JMeter installation or switch to JSR223 Sampler with Groovy language where you will have to initialize the ChromeDriver yourself, but you will have the full control over capabilities and options
Reply all
Reply to author
Forward
0 new messages