cancel
Showing results for 
Search instead for 
Did you mean: 

Capturing web element by using xpath

UrmilaPatil
Level 2

I created an application modeller for web application and also captured the element, but the attribute id in our web application changes continuously, so how can we manually update xpath in application modeller?



------------------------------
Urmila Patil
------------------------------
3 REPLIES 3

Mukeshh_k
MVP

Hi @UrmilaPatil - I am sure stability could be achieved picking other attributes as well or using UIA or AA modes with match Index and couple other parameters but if you are looking to play around with Xpath - Try finding a Label or related element which can be highlighted without the use of WebPath/Xpath and read its Xpath - Try comparing the Xpath of your original element with this Xpath -

13469.png
Just in above example : Button/Label Items has enough attributes (For ex Web Value, Web Text, Element Type & Match Index) to match without Xpath attribute - I would read its Xpath using read stage and basis of my observation (which I have compared on NotePad) on how these values changes my original required element - and would amend/add/replace to create a patterned Xpath for my element. 

but firstly it should be compared enough to know the patterns/behaviour when changing and then keeping the required element Xpath as Dynamic to pass this newly created Xpath through params.

13470.png 



------------------------------
Kindly up vote this as "Best Answer" if it adds value or resolves your query in anyway possible, happy to help.

Regards,

Mukesh Kumar - Senior Automation Developer

NHS, England, United Kingdom, GB
------------------------------

Regards,

Mukesh Kumar

KevinWilson
Staff
Staff

Glad to chat on this if you wish. I'd suggest staying away from XPath and Attr IDs if you can. Pehaps consider Class and CSS Selector.



------------------------------
Kevin Wilson
`Solution Engineer
Blueprism
America/Denver
------------------------------

MichealCharron
Level 8

@UrmilaPatil 

If you are experiencing changing suffixes on on the "id" attribute of the element and you have BP v6.4 and above, you might want to look into XPath expressions in your "Web Path" or "Web Path/XPath" attributes where something that spies like so:

13478.png

Would have an XPath expression of:
13479.png


The XPath expressions give you the speed of the absolute XPaths with the flexibility of dealing with dynamic web pages.



------------------------------
Micheal Charron
Senior Manager
RBC
America/Toronto
------------------------------
Micheal Charron
RBC
Toronto, Ontario
Canada