Xpath Object changed

Hello all,

This Xpath changing each runtime

  • Old Xpath : //label[@id=‘tabscontent:tabView:BWconent_0:treeLeft_0:1:j_idt619’)]
  • New Xpath: //label[@id=‘tabscontent:tabView:BWconent_0:treeLeft_0:1:j_idt484’)]

Help me to set Dynamic Xpath From 619 to 484 …
Set Absolute Xpath for Allthing , even though 619 , 484 … so on

Xpath alway right any runtime :confused:

Thanks

Solution : From Hansen

484.jpg

Xpath Relative.jpg

Run OK.jpg

How to use it : Set Dynamic Xpath

Anyone Know help

Thanks

you could try to use contains in xpath if there is no other object beside that one.
example:
xpath: //label[contains(@id,'tabscontent:tabView:BWconent_0:treeLeft_0:1:j_idt’)]

Hi William ,

There are 2 Object like that :

  • [Contains] : Unavalible
  • :confused:

Need in help

Thank

2Object.jpg

Hi Nam,
I am wondering which element do you want to get…
If it’s the first label, you can try by using

xpath: //label[contains(@id,'tabscontent:tabView:BWconent_0:treeLeft_0:1:j_idt’)]

I believe that Katalon takes the first element found, but if it does not work, you can specify which label you want to take.

example:
xpath: (//label[contains(@id,'tabscontent:tabView:BWconent_0:treeLeft_0:1:j_idt’)])[INDEX]

or if you want to get it by text, this xpath also works…
xpath: //label[normalize-space(text()) = “DLL”]

Regards,
Hansen

Hello Hansen ,

I want to get Fisrt Elenment
You are very kind of help . Your tip perfect

  • Using : Xpath Relative ( 2nd row in Object Path )
  • //div[@id=‘tabscontent:tabView:BWconent_0:treeLeft_0:3:NodetreeLeft_0_’]/div/label

My job is Successful
( See Image for Solution )

I would like to thank you so much !!!

Your Idea help me Solve it

Update Pic

nam said:

Update Pic ( Seem to be not Up Picture ) . So sorry about it