TestProject Forum

Xpath is changing in multiple steps

Hi,

Scenario:
Step1: Click on ID then a pop will open.
Step2: Clear the text in textbox(Textbox highlighted)
Step3: Enter the value for search.

Issue:
I record this scenario, but at the time of execution it is failing. So, I changed xpath manually but the problem is if I change the xpath in Step 1 then it is automatically changing the xpath in Step 2 & Step 3. If xpath is changed in any of the above steps, it is changing xpath in other 2 steps.
I need to give different xpath in each step.

image

Hello @smriti.dalal17
Once you edit an element, you edit it globally, meaning, if you use the same element in multiple steps inside your test, and you edit the element in step A, if step B uses the same element, it will be affected as well.

In those cases, you can just create a new element, so one change won’t reflect on the other.