cancel
Showing results for 
Search instead for 
Did you mean: 

assertion

Highlighted
Occasional Contributor

assertion

Ole,

how would you implement an assertion against a value in the property step?
Can it be done in a XPath Match assertion (without groovy script ) something like this? (I just copied from XPath assertion)

declare namespace ns1='http://services.tvguide.com/v2.5/common/types';
declare namespace ns2='http://services.tvguide.com/v2.5/listings';
//ns2:GetProgramDetailsResponse/ns2:GetProgramDetailsResult/ns1:ClientBatchId

data.ClientBatchId

where data is a property step name
and ClientBatchId is the property name

(basically how would you refer to your property in a standard XPath assertion?)

How would you do that with groovy?

Thanks
2 REPLIES 2
Highlighted
Super Contributor

Hi Nick,

you should be able to do the following:

xpath:

declare namespace ns1='http://services.tvguide.com/v2.5/common/types';
declare namespace ns2='http://services.tvguide.com/v2.5/listings';
//ns2:GetProgramDetailsResponse/ns2:GetProgramDetailsResult/ns1:ClientBatchId/text()

expected value:
${data#ClientBatchId}

where "data" is the name of your Properties Step and "ClientBatchId" the name of the property.

Hope this helps!

regards,

/Ole
eviware.com
Highlighted
Occasional Contributor

Ole,

thanks. It works
New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Want a fun and easy way to learn ReadyAPI and show off your skills? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get a full Raw JMS request

Participate!

Compare an expected JSON value and actual response in Events

Participate!

Fetch value/data from JSON response using Groovy Script

See replies!

Get data from Petstore and add it to Excel sheets

Participate!
Top Kudoed Authors