SeleniumTestability has this sort of functionality:
Run Keyword And Expect Error STARTS: ElementClickInterceptedException Click Button id:hiddenbutton
Element Should Be Blocked id:hiddenbutton
Hide Element id:infoi
Element Should Not Be Blocked id:hiddenbutton
Click Button id:hiddenbutton
Show Element id:infoi
Element Should Be Blocked id:hiddenbutton
Run Keyword And Expect Error STARTS: ElementClickInterceptedException Click Button id:hiddenbutton
Run Keyword And Expect Error STARTS: Element with locator Element Should Not Be Blocked id:hiddenbutton
Layout on of test page is so that there’s element partially on top of the button i want to click. Its not really covered but they overlap and because selenium tries to play ball with the automator, when i try to click on the button, selenium throws exception.
This is afaik due to selenium not knowing if the topmost element passes the click event forward. So while you as a user can click the mouse there and it will work as intended, on automation side, this could be problematic.
So, The example here checks that yes, id:button is blocked… Then i use Get WebElement
for the container that is blocking the button. However, since you do not know what is blocking the element you are interested, you could first get the interaction elements web element, check its x/y coordinates and issue Get WebElement At
keyword for those coordinates. This returns you the topmost element which you can then hide with Toggle Element Visibility
…
See list of extra keywords here: https://rasjani.github.io/robotframework-seleniumtestability/index.html?tag=plugin#Keywords