I have identified web elements uniquely using customized xpath


But, when I run the test script and perform getText() with it Selenium gives me error: NoSuchElement

When i evaluate my xpath in Mozilla, it does show me the header text highlighted as expected. How do I go about identifying headers of columns in this table?

  • 1
    show us the original HTML – Yu Zhang Sep 9 '16 at 2:05
  • may be that element in frames check – Shailendra Rathore Sep 12 '16 at 10:51
  • try to use a conditional wait – lauda Sep 12 '16 at 18:07

First, you need to make sure you are in the correct frame. Testing Pega means you will be dealing with iFrames. If you are still getting the NoSuchElement error, try using XPath by position.

I have used this and it worked pretty good as long as the application is stable. Use the Selenium IDE in Firefox to get the XPath by position. Start the IDE (it will be recording by default when you start it), right-click the element and select verify text. Then open the IDE back up and you can choose the element ID like by ID, name, CSS selector. You can also change it to XPath by position.
Hope it helps you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.