Page 1 of 1

Best Practice Headless Web Driver

Posted: Tue May 22, 2018 10:29 am
by Pamana
Hello,

I'm want to automate our web testing setup and have a general question for my setup.

I want to test our test cases against different browsers with different browser sizes. As the test will run in Jenkins on a machine without graphical interface I need to use headless browsers for chrome and firefox.

I set an endpoint for chrome using:

capabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['headless', 'window-size=1920,1080']
}
}

Can i use different configurations when starting the ".exe"? Or do I use a different approach?

Or do I write a custom function and pass the arguments i.e.:
Host.Current.OpenBrowser(pageUrl," 'headless', 'window-size=1920,1080' ",false,true,false,false,false);
(However, the arguments are not used, when starting the browser on an endpoint).

Thanks for your help.

Re: Best Practice Headless Web Driver

Posted: Tue Jun 12, 2018 7:21 am
by Support Team
Hello Pamana,

Thank you for your post.

You could use the commandline argument "/endpointconfig:<Configuration Name>" for starting your test with a specific endpoint configuration.
As an example, the whole command would look like this:

Code: Select all

MyTest.exe /endpoint:MyEndpoint /endpointconfig:MySpecificConfiguration
I hope, this information is helpful.

regards,
Stephan