How to record the script for dynamic ID generation

2019-07-28 21:23发布

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

2条回答
聊天终结者
2楼-- · 2019-07-28 21:53

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.

查看更多
冷血范
3楼-- · 2019-07-28 21:54

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)

查看更多
登录 后发表回答