13 years ago
How to add assertions for Http request returns html response
Hi,
I am using soapUI 4.0.1.
What I want to do:
Send the http request: http://wwwqa.ford.com/dealerships/locat ... wResults=1, (the zipCode parameter in url is changeable) then verify the returned dealer count>1 and some other key words("We have found...")
What I have tried:
when I send the above http request. That only returned the response in html format(a whole page as browser's), and there's no response in Json and XML tabs. so I tried following assertions:
1. Contains. When I use this assertion to match "We have found", it can works, but when I matched with "** dealers", it cannot work, and said "Missing token in Response". What does that mean? Where is I wrong?
2.Invalid HTTP Status Codes. When I put a invalid zipcode(00000) in the http request and send it. In the Jmeter, it will return 503 error. So I tried it again in the SoapUI, and added Invalid HTTP Status Codes assertion that contains 503. But it passed. Why?
3.XPath Match. When I use a valid xpath "//p[@class='results-message']/strong[1]/text()" to find the element, but it returns NullPointerException. Why? Does Xpath apply for html response?
Could anyone help me to explain my above questions? and what's the better solution to verify the dealer count>0?
I am using soapUI 4.0.1.
What I want to do:
Send the http request: http://wwwqa.ford.com/dealerships/locat ... wResults=1, (the zipCode parameter in url is changeable) then verify the returned dealer count>1 and some other key words("We have found...")
What I have tried:
when I send the above http request. That only returned the response in html format(a whole page as browser's), and there's no response in Json and XML tabs. so I tried following assertions:
1. Contains. When I use this assertion to match "We have found", it can works, but when I matched with "** dealers", it cannot work, and said "Missing token in Response". What does that mean? Where is I wrong?
2.Invalid HTTP Status Codes. When I put a invalid zipcode(00000) in the http request and send it. In the Jmeter, it will return 503 error. So I tried it again in the SoapUI, and added Invalid HTTP Status Codes assertion that contains 503. But it passed. Why?
3.XPath Match. When I use a valid xpath "//p[@class='results-message']/strong[1]/text()" to find the element, but it returns NullPointerException. Why? Does Xpath apply for html response?
Could anyone help me to explain my above questions? and what's the better solution to verify the dealer count>0?