java - Simulating Zoom in Chrome with Selenium -


i'm trying test involves browser zooming in selenium (java). following approach:

webelement html = m_webdriver.findelement(by.tagname("html")); html.sendkeys(keys.chord(keys.control, keys.add)); 

this worked fine in ie, causes exception in chrome saying "cannot focus element", happens whenever attempt send keys in chrome.

the following sources have had similar issues, no workaround listed works me:

https://sqa.stackexchange.com/questions/2023/webdriver-api-failed-to-send-keys-because-cannot-focus-element-better-work

https://code.google.com/p/selenium/issues/detail?id=2328&noredir=1

thanks!

i'm not 100% sure, best use javascript that.

something along lines of:

driver.executescript("document.body.style.zoom=1.0"); // or 0.9 or whatever 

Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -