Selenium Element Not found, even if selenium fills identifier

I am using the Firefox Selenium IDE plugin to create some test cases. I click the Record button to record the steps. When I finished, I stopped recording and will run test cases to see how everything goes. In this one specific element of the table, Selenium identifies it id=my_id_1as during the writing process; when I run the test case, he would say that the item was id=my_id_1not found.

How to not find it if the identifier is found in the Selenium IDE? How can I get around this problem? I also tried to use //tr[4]/td[3]/a. Using this approach (and using the ID), when I click the Find button in the IDE, the corresponding element on the web page will be highlighted in yellow. However, in the test case, it will not be indicated that the element cannot find the one found.

Thanks in advance, Monte

+5
source share
4 answers

Try pausing before the problem command to make sure it is not fully loaded before Selenium tries to find the item. If this fixes the problem, you can instead replace the pause with a more robust wait condition.

+7
source

, , , , , , , Xpath ID

0

Maybe he creates a new identifier every time. Therefore, you can make a regular expression similar to the one I used below.

//form[@id='adminLogin']/div/div[4]/input

Give it a try. It worked for me.

0
source

run the test in slow IDE mode.

-1
source

All Articles