I have to click at an element which is intercepted by other element, so what i’m doing is that, I’m trying to scroll down the Vertical scroll bar and try to click my target element, so to scroll this i’m using the below code
JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("window.scrollBy(0, -800)", "");
But the above code is not scrolling down the scroll bar
Note: i also tried to movetoelement. That is also not working, please help me with your solutions
action.moveToElement(seatLayout.seat_A16);
Thread.sleep(2000);
seatLayout.seat_A16.click();
2
Answers
To scroll down:
To scroll up:
To scroll the element within the viewport:
References
You can find a couple of relevant detailed discussions in:
you can also use this method
here 0-1 is the height of the page. I have selected 0.9 for my project