Ask a Question

update xpath assertion in ready api

samirc23
Contributor

update xpath assertion in ready api

Hi,

 

we have 100+ test cases and in most of the test cases we have xpath assertion, but now due to requirement change we need to update all the xpath assertion. 

 

so i was wondering that is there anyway we can update any assertion file/something that will change xpath assertion response ?

OR do i need to update in each test cases ?

 

Many Thanks,

Sam

3 REPLIES 3
nmrao
Community Hero

Re: update xpath assertion in ready api

If there is some pattern to find the value to be replaced, then it is possible to update using groovy script.

Please see script provided in Message #11 of the below thread for similar case
https://community.smartbear.com/t5/SoapUI-Open-Source/Updating-SLA-time-assertion-for-all-the-test-c...


Regards,
Rao.
samirc23
Contributor

Re: update xpath assertion in ready api

thanks for the prompt reply, but if out of 100 xpath assertion, 20 assertion is having different patter and remaining different pattern ?

 

do i have to mention that which test cases needs to updated or it just update all the test cases which contains xpath assertion ? 

nmrao
Community Hero

Re: update xpath assertion in ready api

Do you mean the below?
20 test steps have one xpath (all have same xpath)
80 test steps have another xpath

Then you can update the xpath conditionally say if current step name is in list1 update xpath1. Similarly if current step name is in list2, then update xpath2.

Hope this helps.


Regards,
Rao.
cancel
Showing results for 
Search instead for 
Did you mean: