I use Selenium Webdriver (Ruby) to automate my web application, and my web application has this carousel, in which my element constantly moves in a loop. By the time I find this item and try to click it, the item is moving forward. I canβt find this item. I tried to find and click this moving element by running the following code:
{
ele_button = driver.find_element(:xpath,"xpath")
sleep 10
ele_button.click
}
I thought that βsleep 10β could make this element wait 10 seconds and then click it. But this does not work, and I get an ElementNotVisibleError whenever I run my script.
Question:
Is it possible to automate a moving element? If yes, please provide me a solution.
source
share