selenium webdriver - Dealing with elements that are not visible due to zoom level -


we have automation processes have been scraping website months. discovered our scraper isn't working.

turns out, website has been changed have table 9 columns placed inside frame. however, either frame or table styled improperly , first 6 columns on screen @ 100% zoom because table big. when zoom out 50%, rest of columns manage fit in view.

unfortunately, there button on last column need click, selenium doesn't , says element not in view @ 100% zoom.

when use following check whether it's in view or not

while (!elmt.isdisplayed()) {   // wait } 

and manually zoom page out column button comes view, clicks button.

how can zoom page out?

yes had similar issue while testing in safari.

the work around zoom out page programmatically before perform operation on page.

with of js can this:

document.body.style.zoom = "30%" 

or whatever value required. in selenium make use of javascript engine execute script.

this worked work around worked me.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -