webdriver - chrome browser settings

123 views
Skip to first unread message

Auro

unread,
Oct 22, 2016, 7:50:49 AM10/22/16
to jmeter-plugins
Hi guys,
I need to run tests on a virtual machine where chrome works only if started with the --disable-gpu option.
When I try to run the test via chromedriver, according to the chromedriver log, this switch is not  used  even if starting chromedriver by command line 

 ../chromedriver --disable-gpu

and using jp@gc - Remote Driver Config in the script.

The option is not passed to chrome browser

Do you know if it is possible to set it into the script? Something like that....



var chrome_options = WDS.browser.ChromeOptions()

chrome_options.add_argument('--disable-gpu')

var chrome = WDS.browser.Chrome(chrome_options=chrome_options)

WDS.sampleResult.sampleStart()

try
{

   WDS.browser.get('${SRVURL}')

Auro

unread,
Oct 22, 2016, 9:19:00 AM10/22/16
to jmeter-plugins
Hi, I found a workaround. To set chrome browser option we can edit the file google-chrome into the chrome installation directory.
Just adding the switch at the end of the file:

if [[ -n "$CHROME_USER_DATA_DIR" ]]; then

  # Note: exec -a below is a bashism.

  exec -a "$0" "$HERE/chrome"  \

    --user-data-dir="$CHROME_USER_DATA_DIR" "$@"

else

 # exec -a "$0" "$HERE/chrome"  "$@"

exec -a "$0" "$HERE/chrome" \

    --disable-gpu "$@"

fi


This option will be used by all the chrome and chromedriver sessions

Reply all
Reply to author
Forward
0 new messages