Hi,
I would like to know if it is possible to use the Xpath instead of Full xpath while capturing the UI.
Full Xpath : /html/body/div[1]/div/div/div[1]/main/div/div[2]/div/div/div/div/div/div/div[2]/div/div/div/div[1]/div/div/div[1]/div/div/div[2]/div/div[2]/div
Xpath:
//*[@id="3748444"]/div/div[1]/div/div/div[1]/div/div/div[2]/div/div[2]/div
As we have defined an object Id in the xpath, I would like to know how can I use the xpath instead of Full xpath?
Please advice
Use xPath instead of Full xpath
Re: Use xPath instead of Full xpath
Hi,
The best you can do, is to post a Ranorex snapshot (NOT screenshot), so we can recommend you the best xpath for your needs. Without knowing the context, it's pretty hard to suggest anything reliable. Generally speaking, both xpaths are fragile and will most probably fail in future. You should get rid of all indexes and find some usable attributes (like class or innertext) or use xpath relationship operators, which can make your xpath much more stable. But as mentioned, without snapshot, it's impossible to suggest anything reliable
The best you can do, is to post a Ranorex snapshot (NOT screenshot), so we can recommend you the best xpath for your needs. Without knowing the context, it's pretty hard to suggest anything reliable. Generally speaking, both xpaths are fragile and will most probably fail in future. You should get rid of all indexes and find some usable attributes (like class or innertext) or use xpath relationship operators, which can make your xpath much more stable. But as mentioned, without snapshot, it's impossible to suggest anything reliable
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
Re: Use xPath instead of Full xpath
HI,
Thank you for your quick response.
Attached the snapshot could you please advice. We have an Inner text attribute, I would also like to use some other attributes additionally.
As AUT has frequent change in the Xpath thats why I was thinking if I can use the Id as an reference attribute.
Please advice
Thank you for your quick response.
Attached the snapshot could you please advice. We have an Inner text attribute, I would also like to use some other attributes additionally.
As AUT has frequent change in the Xpath thats why I was thinking if I can use the Id as an reference attribute.
Please advice
You do not have the required permissions to view the files attached to this post.
Re: Use xPath instead of Full xpath
Hi,
Thanks for the snapshot. As I've suspected, there is plenty of attributes to use If I were in your shoes, I would use the xpath like this:
/dom[@domain='devfsaa.de.kpmgsofy.com']//div[#'app']//div[@class~'s-tab']/div[@title='Overview']
What is the xpath returned by the Tracking/Recording tool?
If you are not happy with the default generated xpath, you can change the way the xpath is generated by editing the xpath weight. Please check this user guide chapter and blog post:
https://www.ranorex.com/help/latest/ran ... e-weights/
https://www.ranorex.com/blog/automated- ... namic-ids/
Thanks for the snapshot. As I've suspected, there is plenty of attributes to use If I were in your shoes, I would use the xpath like this:
/dom[@domain='devfsaa.de.kpmgsofy.com']//div[#'app']//div[@class~'s-tab']/div[@title='Overview']
What is the xpath returned by the Tracking/Recording tool?
If you are not happy with the default generated xpath, you can change the way the xpath is generated by editing the xpath weight. Please check this user guide chapter and blog post:
https://www.ranorex.com/help/latest/ran ... e-weights/
https://www.ranorex.com/blog/automated- ... namic-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