cancel
Showing results for 
Search instead for 
Did you mean: 

Copy assertion

ab2017
New Contributor

Copy assertion

Dear community members,

 

I would like to know how can I copy assertions from 1 test case to another, such that the referred expected values are also updated accordingly. Here is my scenario:

 

Test Case 1: contains DataSet1, RestRequest1, Assertion1

Test Case 2: contains DataSet2, RestRequest2

.... and so on... upto

Test Case 60: contains DataSet60, RestRequest60

 

The Assertion1 (of test case 1) is a Message content assertion and its expected value is referred as ${DataSet1#out_value}. My intention is to copy assertion1 to the other 59 test cases. But when I copy assertion 1 to TestCase n, the copied assertion is still referring to ${DataSet1#out_value}. And then I have to manually modify each copied assertion to DataSet n.

 

Is there a mechanism where when I copy assertion to testCase n, it automatically refers to ${DataSet n#out_value}.

 

Thanks in advance.

Tags (3)
3 REPLIES 3
depstein
New Contributor

Re: Copy assertion

I don't know how to do what you want in SoapUI, but if all else fails, directly editing the project XML file could be an easier option than correcting assertions in the UI.

nmrao
Community Hero

Re: Copy assertion

Isn't it comes under Data driven test instead of copying the same steps again and again for n times?


Regards,
Rao.
ab2017
New Contributor

Re: Copy assertion


@nmrao wrote:
Isn't it comes under Data driven test instead of copying the same steps again and again for n times?

Thanks for reply.

If I understand your point correctly, if the same data set with same values are used for all tests, then it is a Data Driven test.

But in my case, the data for every test is different and specific for that test only, and thats the reason why I need n number of Data Sets, one for each test. 

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors