Answer the question
In order to leave comments, you need to log in
Why doesn't selenium find a specific locator on the page?
For more than half a year, I slowly struggled with the bug described below in my tests and could not even come up with some rational explanation for what was happening.
So, tests are performed in fully automatic mode on 2 machines, a client and a selenium server, in which some content is loaded in the browser, web interface elements are searched by locators, web buttons, checkboxes, etc. are pressed.
The problem is reproduced somewhere in every fifth case at least , in a certain place of a certain test case there is no element by the locator, but rather the delete button the
exact name of the locator:
//div[@class="listActionItem" and text()='delete']
And in 3 different ways I made sure that such a button is present:
1 Visually in the screenshot this button is visible
2. I achieved playback in the debugger and made sure step by step that the button is present and located by the above locator name (using the
firebug plugin in firefox) present with this locator
After unsuccessful attempts to figure out what the problem is, I decided to do a clumsy workaround, inserting pauses, repeated page refreshes, trying to return to the previous page and go to the problematic one again, all this did not solve the problem.
It is not clear why exactly this button turned out to be problematic, the test uses dozens of other buttons, including delete on other pages, and there were no such problems anywhere.
It is not clear why the problem is reproduced randomly, i.e. in theory, this says that the problem is not in the name of the locator.
Who has any new ideas to offer my desperate brain?
Answer the question
In order to leave comments, you need to log in
had similar problems with watir-webdriver (selenium implementation in ruby).
in each case, the probable causes and solutions were different, so not as a universal solution, but as ideas of what else to try:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question