Ask a Question

XPath Expression to RawRequests doesn't work after update to 1.8 version

AntonE
Staff

Re: XPath Expression to RawRequests doesn't work after update to 1.8 version

Hi, lermimou

 

Sorry, I don't understand why you had to use RawRequest if you didn't need the headers. What exactly are you trying to do? If you want to transfer the whole request, you shouldn't specify XPath, just select Request property.


Anton Egorov
ReadyAPI developer
lermimou
Occasional Contributor

Re: XPath Expression to RawRequests doesn't work after update to 1.8 version

For Example, this is my request.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="http://urn:MEWSUserPref">
<soapenv:Header/>
<soapenv:Body>
<urn:HelloWorld>
<urn:in0>hello${#Project#timestamp}@test.fr</urn:in0>
</urn:HelloWorld>
</soapenv:Body>
</soapenv:Envelope>

 

In the assertion, i compare a parameter to the in0 request parameter

declare namespace ns1='http://urn:MEWSUserPref';
//detail[1]/ns1:MEServiceException[1]/ns1:in0[1]

 

${myTestCase#Request#declare namespace urn='http://urn:MEWSUserPref'; //urn:setFilterSettings[1]/urn:in0[1]}

With this method, everytime i launch the assertion, a new timestamp is generated, due to the dynamic parameter.

 

I need to check the parameter sent in the request so i used the RawRequest

${myTestCase#RawRequest#declare namespace urn='http://urn:MEWSUserPref'; //urn:setFilterSettings[1]/urn:in0[1]}

In this case, the parameter is always the same in the assertion.

 

The same problem appears with propertyTransfer steps. The Request option transfers the ${#Project#timestamp} instead of the timestamp generated in the request.

 

How can i check these cases without the rawRequest?

 

AntonE
Staff

Re: XPath Expression to RawRequests doesn't work after update to 1.8 version

Thank you for clarification, now I see the problem. I think this is a bug and Request property should have the value of the property, not a property expansion string, but we need to discuss this with the team.

 

However, I tried to use Request property in XPath and Groovy assertions and it seems to be expanded automatically, so assertions pass. I used property expansion string as an expected value, but assertions definitely expand it - you can check, just use wrong expected value and check the actual value in the error message). What type of assertion do you use? Where do you generate timestamp property?


Anton Egorov
ReadyAPI developer
lermimou
Occasional Contributor

Re: XPath Expression to RawRequests doesn't work after update to 1.8 version

Hi,

 

Thanks for your answer.

I defined my property in the project custom property with this value :

${=new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date())}

 

So everytime i used this property, a new timestamp is generated.

 

I aggre with you, the property expansion expand the property in the assertions but a new value.

 

I hope this bug will be fixed asap.

 

AntonE
Staff

Re: XPath Expression to RawRequests doesn't work after update to 1.8 version

And what do you use as an expected value in the assertion? Property expansion will get a new value every time assertion is checked, no matter how actual value is formed.


Anton Egorov
ReadyAPI developer
lermimou
Occasional Contributor

Re: XPath Expression to RawRequests doesn't work after update to 1.8 version

the expected value is the value of the request parameter filled the dynamic property filled

example:

 

<urn:in0>hello20160726113826130@test.fr</urn:in0>

 

That's why i need the real value sent in the request (actually, only accessible through the rawRequest)

AMA
New Contributor

Re: XPath Expression to RawRequests doesn't work after update to 1.8 version

Same problem here..

Can't use data via XPath from the raw request with version 1.8, We use this on serveral places property transfer, GetData in requests, ...

 

When will this be fixed and what do you suggest we do in the meantime with this know bug? Install the previous version?

 

Kind regards,

Arjan

joshcacho
Occasional Contributor

Re: XPath Expression to RawRequests doesn't work after update to 1.8 version

Hi. I originally entered this issue and they emailed me yesterday indicating the problem was fixed in the nightly build. I haven't had time to try it yet but that is what I will be doing today. Hope this helps. I just rolled back to the previous version, 1.7 in the meantime.
AntonE
Staff

Re: XPath Expression to RawRequests doesn't work after update to 1.8 version

Yes, we got back to how things were in 1.7: both Request and RawRequest properties contain request body, Request with property expansion expressions and RawRequest with already expanded values, exactly as it was sent. Please, download the nightly build if you had issues with them.


Anton Egorov
ReadyAPI developer
AMA
New Contributor

Re: XPath Expression to RawRequests doesn't work after update to 1.8 version

It seems to be working again, thanks!

cancel
Showing results for 
Search instead for 
Did you mean: