java - Input field hidden by title in selenium -
i'm working on automated selenium test has header fixed position.
div#floatingdiv { position: fixed; background-color: #000000; color:white; }
this floating header getting in way when try automate selenium tests using firefox web driver.
what appears happening when selenium clicks element off screen firefox web driver scrolls page such button accessing @ top of page , clicks element. since header has fixed position element become hidden behind header , test fails.
is there way directly control scroll bar in selenium?
having done more experiments issue noticed issue happens when accessing buttons off bottom of page not input fields.
try following untested java code , need tweaks , how scroll
webelement input = (locatable) driver.findelement(by.xpath("some path input")); int y = (locatable)input .getcoordinates().getlocationonscreen().gety(); ((javascriptexecutor)driver).executescript("window.scrollby(0,"+y+");"); input.click();
Comments
Post a Comment