问题
I am working on Selenium IDE. Currently I am facing problem related to dynamic id. I have recorded one script, but when I run it again it fails because id changes every time.
Is there any way to get rid of this?? Waiting for reply
thanks in advance
回答1:
You should use other type of locators (for example xPath - as Pavel Janicek wrote).
Here is an article about Selenium locators http://www.qaautomation.net/?p=188
Read it and choose the best way for you.
回答2:
Generally - try switching from ID search to XPath. See examples here: http://zvon.org/xxl/XPathTutorial/Output/example1.html
But in that case you have to know that your element is always first SPAN of second table (just example)
来源:https://stackoverflow.com/questions/8817869/how-to-record-the-script-for-dynamic-id-generation-in-selenium