cancel
Showing results for 
Search instead for 
Did you mean: 

assertion xpath match

Highlighted
Super Contributor

assertion xpath match

Hello,
Some time it necessary to put an assertion on a value in the response and compare it to some value in either some other response or request. The current assertion wizard is great but it would be helpful if in the 'expected Result' you can specify a XPath and pick any step and value from the testcase.

hopefully my request made sense.
Also, do you have a rough estimate as to when 1.8 is coming out ?

Thanks

Ali
7 REPLIES 7
Highlighted
Super Contributor

Hi Ali,

thanks for this idea, it hasen't even occured to me :-).. since you can use property-expansion in the expected content field, you could manually enter something like ${AnotherRequest#Response#...xpath-expression...}, but a wizard would obviously make it easier.. thanks!

We are planning to release 1.7.2 in 1-2 weeks, the main focus of the release is project/test-management, improved usability (drag-and-drop, etc..), stability and a number of bug-fixes..

regards,

/Ole
eviware.com
Highlighted
Super Contributor

Hello Ole,
The wizard will be really helpful. In the mean time I tried the properties expansion but I think I am doing something wrong. can you please help.

In my expected window in the assertion, i have ->

declare namespace lis='http://services.tvguide.com/v2/ListingPreferenceService';
${CreateCustomGrid#Request#//lis:CreateCustomGrid/lis:request/lis:CustomGrid/lis:Name/text()}


I get the following error when I test the assertion;
...comparisonFailure:expected but was

seems like the xpath is not getting translated property to 'CustomGridName12' which is the value in the request.
Highlighted
Super Contributor

Hi Ali,

thanks.. I'll check into this.. can you post the entire request you are expanding from? (or mail to ole@eviware.com)?

A side-note; you can't declare namespaces when using property-expansion, the prefixes in the actual request will be used..

regards,

/Ole
eviware.com
Highlighted
Super Contributor

Request: I want to use the 'name' value from this request to be used in my 'expected window'


 

 
     
       
       
           
           
           
            a345b9a3-213e-40d0-89b2-eb5fba585df0
           
           
             
             
             
              CustomGridName12
              false
             
             
                 
                  696
  700
  873
             

              3
              2007-05-26T23:10:53-08:00
              3
              false
              false
           

            2007-05-26T23:10:53-08:00
       

     

 
Highlighted
Super Contributor

Hi,

thanks.. it should work ok if you specify

${Request Step#Request#//lis:Name/text()}

Unfortunately there is a bug in the XPath Assertion editor window so it will not work there with the "Test" button, but should work when either resubmitting the containing test-request or running the containing TestCase..

let me know!

regards,

/Ole
eviware.com
Highlighted
Super Contributor

Ole,
You are right, it does not work with 'Test' but when I run the test case, it works fine. One good feature would be to figure out the 'Xpath' of any element. It would be nice if you could right click on some element and click on 'view Xpath'. This way its much easier to compute XPath
Highlighted
Super Contributor

Hi,

if you put the caret on the desired element or select it in the outline view, and the select the XML Inspector from the inspector tabs at the bottom, you will see the xpath expression for the current node there..

see http://www.soapui.org/userguide/message ... _Inspector for a screenshot..

regards!

/Ole
eviware.com
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors