java - Specifying custom screen resolution in Selenium tests -


in below blog mentioned, can modify screen resolution during selenium test runs. http://blog.testingbot.com/2013/03/15/screen-resolution-option-now-available-for-all-selenium-tests

i have tried below code(as mentioned in "https://saucelabs.com/docs/additional-config"), not setting specified resolution. still not available selenium? please me.

desiredcapabilities dc=new desiredcapabilities();     dc.setcapability("screen-resolution","1280x1024"); 

sauce labs != selenium

sauce labs use capability provision vm desired resolution, it's not capability selenium knows about.

selenium not capable of modifying desktop resolution!

if want modify browser size in selenium matches specific resolution can a:

driver.manage().window().setsize(new dimension(1024, 768)) 

the above not supported opera driver, instead need do:

desiredcapabilities capabilities = desiredcapabilities.opera() capabilities.setcapability("opera.arguments", "-screenwidth 1024 -screenheight 768") 

while setting browser size not same setting screen resolution, should intents , purposes meet requirements.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -