Closed sirj77 closed 9 years ago
Can you use Find.Element and then .Click?
Pretty sure web driver automatically scrolls when you do that...
Yes, you are right, but what if I want to see the actions of clicking in a browser?
It should be visible to you while it happens?
Just for the test purpose, it shouldn't be visible for me, actually :)
Right. So you want the Visible property of the IWebElement returned from Find.Element to be true?
Try this (without the click and changed for C#): http://stackoverflow.com/a/12042268
robdmoore, thank you
Did that work for you? Feel free to post the final C# code so other people that find this know how to do it
Well, I just wanted to observe the scroll down action in Browser while the tests are running. I've tried that piece of code that you sent me, but it didn't work, got some error, I tried it in a bit simple way (without scrolling to the particular element on the page, just scrolled down to the bottom of the page) and it works for me:
public void ScrollDownToTheBottomOfThePage()
{
var js = String.Format("window.scrollTo(0, document.body.scrollHeight - 150)");
Execute.Script(js);
}
Hi, just a simple question: How to do a scroll down to the bottom of the page properly? (this question is also for the go to the top/center of the page). My tests are needed to click on some element, but this element is located of the bottom of the page.
I tried to do like:
But I don't understand what I should put into ExecuteJavaScript<??> that my action would happen correctly.