We're working on centralizing our automated testing development systems by using an Azure virtual machine which hosts our Leapwork Controller and Selenium Grid.

The Selenium grid has been setup by using the standalone JAR and combining this with several webdrivers. I will focus my question on the Chrome webdriver since that currently has my main priority.

So I have written a few basic batch files that forms our Selenium grid. This works very well when started manually. Here's the content of two of my batch files.

Selenium Standalone Server

java -jar "C:\Selenium\server\selenium-server-standalone-%SeleniumServerVersion%.jar" -role hub -debug -log "C:\Selenium\logs\selenium-hub-log.txt"

Chrome Webdriver

java -Dwebdriver.chrome.driver="C:\Selenium\drivers\chromedriver-2.41.exe" -jar "C:\Selenium\server\selenium-server-standalone-3.14.0.jar" -role webdriver -hub http://localhost:4444/grid/register -browser "browserName=chrome,maxInstances=4,platform=WINDOWS" -debug -log "C:\Selenium\logs\selenium-node-chrome-log.txt"

My problem is that once I've added this to Windows Task Scheduler as shown belown, the browser viewport defaults to a much lower resolution. Therefor the website I want to test shows it's mobile design, which the tests weren't designed for.

Task properties

I've asked this question in the #selenium IRC chat and I know that there are no resolution parameters to add to the command. I'm kind of stuck here, since I don't want to manually start the batch files each time the system has to reboot. Does anybody have an out-of-the-box solution for my problem?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.