Web Testing - How to extract Network Responses and http status codes with TC
When conducting a UI web test (UI test of an online application), is there a way to monitor the network reposes (the returned http status codes) and ensure no 400/500 error codes (or other error codes) appeared while running the test? There are a few tests where I got a few error messages during the execution of one of my UI tests ... one of the response messages was an error message, however, the TC test still passed. The test really shoudl not have passed since there was an error message.
Similar to how you can monitor network reposes in selenium:
Here are some different ways you can handle error messages
I wasn't quite looking for error handling when errors occurred in the test. While I am running a UI test, I would like for testComplete to monitor the Network area of the browser (in the developer tools of chrome). If a failure status shows up (such as a 400 or 500 series http response code), then TestComplete would push that onto a stack or write it to the log as a 'Warning' message. Even though you get a 400 or 500 response in the network tab, this doesn't mean the test is going to fail. So, a test could pass, but there were some glitches with the website that the TestComplete test wouldn't catch if it weren't monitoring the network traffic (the http response codes).
No, I am not sure this can be done now in TestComplete.
While this seems to be a useful feature (but why stick to Chrome only and not to request the same functionality for all browsers that provide developer tools?) and one can create a feature request via https://community.smartbear.com/t5/forums/postpage/board-id/TestXCompleteFeatureRequests, I would say that requests monitoring is rather from integration and/or load testing areas.
A possible approach with TestComplete to monitor request results is to use some proxy (ProxyMob, Fiddler?), set your tested application to send all traffic through this proxy and then request proxy if some requests ended with 4xx or 5xx result codes.
/Alex [Community Champion]
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
Hi @AlexKaras , thanks for the reply. You are correct. It would be nice if this functionality existed for all browsers; not just chrome.
The only reason I could see for not having this as a feature in TestComplete would be if monitoring the traffic status codes slowed down the tests too much.
I will submit a feature request; thanks for the suggestion.