Reputation: 809
I've already looked into the thread here: Debugging "Element is not clickable at point" error and Selenium webdriver can't click on a link outside the page which goes to suggest to use some javascript scrolling to the element.
The question I have may just be a waste of breath as I await the developer to fix the underlying bug of the fact that I cannot scroll this part of the page.
During the run of my selenium test, I try to click on an element that is out of the window area (and it can't scroll, that is the bug I know about). My question is, for Selenium webdriver tests, can you only click on elements that are in the viewable area and you cannot scroll to?
Or is it pretty much failing (rightfully so, because of the bug) and selenium works purely with what is visible on the screen?
Thanks, hopefully it's a bit clear.
Upvotes: 1
Views: 2082
Reputation: 341
I once had a combo box that wasn't in view that I needed to expand. What I did was use the Actions builder because the moveToElement() function will automatically scroll the object into view. Then it can be clicked on.
WebElement element = panel.findElement(By.className("tabComboBoxButton"));
Actions builder = new Actions(this.driver);
builder.moveToElement(element);
builder.click();
builder.build().perform();
(panel is simply a wrapped element in my POM)
Upvotes: 1