Selenium click stop working after several iteration
I have a test that clicks on a preview link > opens up a window and I do some sort of test in that newly open window. I then close that window and click on the preview link again and repeat.
Let's say the test follows this pattern for 100 times. Once it hits say 10th times, clicking on the preview link to open the new window doesn't seem to do anything. I don't see a new window opening, and the code seems to still be running. It doesn't break, no exceptions are thrown, etc When I stop the code execution, it seem to have moved on past the line of code that clicks on the preview link... This happens in firefox and chrome
Can someone explain what may be happening?
Demir last edited by user
It'll be difficult without the code you're using. Other helpful items would be if there's a browser that the test always works on, and what version of Selenium you're using.
That said, are you testing for your WebElement being visible and enabled as well as not null before you click? If it's in a clickable state (for example, visible, but disabled), WebDriver will click on it without throwing an exception, and nothing else would happen.