Hi Folks,
As we all aware that any web pages could have many dynamic ui elements.
What are the best practice to stick with in order to maintain the same xpath when a page transit from one state to another(with different dynamic content)?
xpath and dynamic content
Re: xpath and dynamic content
Hi,
Basically, you should not use indexes in your xpaths. Indexes should be your last resort to identify something. You should use them only if there is really no way to identify an element by using relationship operators, relative paths, etc...
Another thing you should keep in mind is that if the only available identification attribute is for example InnerText and the inner text of given element tends to change, you should not use such attribute as well. Eventually, you should use a regular expression to identify a text within the inner text, which does not change.
More suggestions regarding automating UI with dynamic controls can be found in this blog:
http://www.ranorex.com/blog/automated-t ... ynamic-ids
Basically, you should not use indexes in your xpaths. Indexes should be your last resort to identify something. You should use them only if there is really no way to identify an element by using relationship operators, relative paths, etc...
Another thing you should keep in mind is that if the only available identification attribute is for example InnerText and the inner text of given element tends to change, you should not use such attribute as well. Eventually, you should use a regular expression to identify a text within the inner text, which does not change.
More suggestions regarding automating UI with dynamic controls can be found in this blog:
http://www.ranorex.com/blog/automated-t ... ynamic-ids
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration