SOAP UI Adding XPath Assertions in SOAP UI Test Case


Adding XPath Assertions in Test Case

  1. Select  your Test Case from project.
  2. Open Test Steps of this test case and double click on it

  1. Click Assertion
  1. Click Add Assertion
  1. Select XPath math and click add


  1. Double Click your Named Assertion  and Then first of all click declare link on window to declare name spaces  for Response
  1. Write your script using these name space and make a Path Expression  like the one in image


XML:
  
     
        
           true
           City Found
           MA
           Boston
           Boston
           
              
                 2014-08-05T00:00:00
                 2
                 Partly Cloudy
                 
                    
                    83
                 
                 
                    
                    10
                 
              
              
                 2014-08-06T00:00:00
                 1
                 Thunder Storms
                 
                    68
                    79
                 
                 
                    30
                    50
                 
              
              
                 2014-08-07T00:00:00
                 2
                 Partly Cloudy
                 
                    64
                    78
                 
                 
                    40
                    20
                 
              
              
                 2014-08-08T00:00:00
                 4
                 Sunny
                 
                    62
                    76
                 
                 
                    20
                    20
                 
              
              
                 2014-08-09T00:00:00
                 4
                 Sunny
                 
                    63
                    78
                 
                 
                    20
                    10
                 
              
              
                 2014-08-10T00:00:00
                 4
                 Sunny
                 
                    63
                    80
                 
                 
                    10
                    10
                 
              
              
                 2014-08-11T00:00:00
                 4
                 Sunny
                 
                    65
                    81
                 
                 
                    10
                    10
                 
              
           
        
     
  

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s