Ask a Question

Assertion of selective elements in a teststep

SOLVED
nmrao
Community Hero

Re: Assertion of selective elements in a teststep

Quick question, do you get two rows in each response for step3's request?


Regards,
Rao.
nmrao
Community Hero

Re: Assertion of selective elements in a teststep

Isn't it possible to have the expected data in fixed column?

The alternative is to custom property one per response XML element and the desired colum data be set to the custom property before. But it may not be feasible to do that as XPath assertion would run as soon as the response is received. Otherwise, script assertion is flexible if you can do that.

Edit:
It is possible with custom property if you know for particular condition even if the expected data column changes, do the assignment of expected data to custom property as suggested earlier. And use custom property as expected data insted of data source field. Then have actual test step after the assignment. So that XPath assertion can be run without any issues.


Regards,
Rao.
anand1
Contributor

Re: Assertion of selective elements in a teststep

No it is only one row in the step3

In this eg

Expected Data

Iteration 1 - R1- c1,c2,c3,c4,c5,c6

Iteration 2 - R2-c1,c2,c7,c8,c9,c10

 

Actual Data-Coming from my request

Iteration 1 - OR1- oc1,oc2,oc3,oc4,oc5,oc6

Iteration 2 - OR2- oc1,oc2,oc3,oc4,oc5,oc6

 

R- means row and c means columns and oc - output column,OR- output row

When i am running the loop

Iteration 1 - Xpath assertion : R1-OR1 -- True

Iteration 2 - Xpath assertion : R2-OR2 -- false

Added the Iteration's

 

Hope this helps

nmrao
Community Hero

Re: Assertion of selective elements in a teststep

Ok. Please check other reply if you can do that.


Regards,
Rao.
anand1
Contributor

Re: Assertion of selective elements in a teststep

No it is not possible..!!

With respect to the discussion..I feel that it will be fine if I use script assertion as using that I can put a condition and then assert it.

 

Thanks for tyring to help me out. appreciate your efforts.

nmrao
Community Hero

Re: Assertion of selective elements in a teststep

Please check Edit part which is done just now.


Regards,
Rao.
anand1
Contributor

Re: Assertion of selective elements in a teststep

Thanks @nmrao for your suggestion

I have never used custom property earlier, however I am able to achieve it using script assertion and for now it seems that it running well with my huge data.

Still if i run into any scenario..will surely try the custom property approach.

 

Thanks for your help.

View solution in original post

HimanshuTayal
Community Hero

Re: Assertion of selective elements in a teststep

Yes, for this dynamic assertion use the script assertion, as you can write code to achieve every condition.

 


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal
cancel
Showing results for 
Search instead for 
Did you mean: