简体   繁体   中英

How to record the script for dynamic ID generation in Selenium

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

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)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM