1

on my website I'm trying to automate, there is a floating header. As selenium is always scrolling to the top of an element, I'm getting the error message that some other element would receive the click. After searching a bit on the net, there should be a solution to set the scroll behavior (elementScrollBehavior) as a desired capability.

Now my question: As Desired Capabilities is for remote WebDriver implementation, it's not really useful in my case. Is there a possibility to change the scroll behavior in a way, that I can run my local instance with the behavior of scolling to buttom of an element?

Many Thanks & Regards!

1
  • 1
    dc.setCapability("elementScrollBehavior", 0); // 0- from Top, 1 - from bottom
    – Abhinav
    Feb 28, 2017 at 10:03

1 Answer 1

2

Desired capabilities are not only for RemoteWebDriver implementation, you can set it even on your local driver instances. For example, if you are using FirefoxDriver you could do something like this in your case:

DesiredCapabilities cap = new DesiredCapabilities();
driver = new FirefoxDriver(cap.setCapability(CapabilityType.ELEMENT_SCROLL_BEHAVIOR, 1);

You can also use RemoteWebDriver on your local machine (just pass localhost url), your localhost can also be selenium node, it doesn't have to be on some remote machine.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.