cancel
Showing results for 
Search instead for 
Did you mean: 

update xpath assertion in ready api

Highlighted
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
Highlighted
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.
Highlighted
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 ? 

Highlighted
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.
New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
Let's start July with new challenges!

Create a script to change request body before sending it to the server for the TechCorner tag!


Scripts created in June:
- A script to generate a request body based on data from Datasource
- A script to go through all response nodes and check the value of the required field
- A Dispatching script to get responses based on the values in Request Body
- A script to add a new tag and assign it to all TestCases in a TestSuite
Top Kudoed Authors