Selenium Element Not found even if Selenium populates the id

16,680

Try a pause before the problem command to see if it isn't loaded completely before Selenium tries to find the element. If that fixes the problem, you can replace the pause with a more robust wait-for condition instead.

Share:
16,680
Monte Chan
Author by

Monte Chan

I was a co-manager of the ColdFusion user group in San Antonio, TX. When I am not coding, I like to run. I run marathons.

Updated on June 18, 2022

Comments

  • Monte Chan
    Monte Chan almost 2 years

    I am using Selenium IDE Firefox plugin to create some test cases. I click the Record button to record the steps. When I am done, I stop the recording and would run the test cases to see how things go. In this one particular element in an HTML table, Selenium identifies as id=my_id_1 in the recording process; when I run the test case, it would say that Element id=my_id_1 not found.

    How can it be not found when the ID is detected within Selenium IDE? How can I get around this problem? I have tried using //tr[4]/td[3]/a too. Using this approach (and using ID as well), when I click the Find button in the IDE, the corresponding item on the web page would be highlighted in yellow. However, the test case would fail saying that the element cannot find found.

    Thanks in advance, Monte

  • Monte Chan
    Monte Chan about 12 years
    Thank you very much. I did a ClickAndWait in the command before the one in question and that did the trick.
  • Tim
    Tim almost 12 years
    +1, I had the same problem and adding in a pause fixed the issue for me.