Forum Discussion
tristaanogre
15 years agoEsteemed Contributor
If all you're doing is testing via the UI, then not easily as far as I know. TestComplete itself is not sending the HTTP request, the browser is and so the response code is sort of hidden.
However, you can instantiate instances of the MSXML2.XMLHTTP objects through TestComplete, send a GET request and then evaluate the response code from that.
Now, based upon the example that you noted, you probably could use evidence from the UI, such as if the URL of the resulting page is your error page, validating the text on that error page for the 403 error, etc. These would be evidence through the UI that would indicate what response code you're using. But when it comes to the actual low-level HTTP protocol Request/Response, you're best bet is to utilize the native XMLHTTP object.
However, you can instantiate instances of the MSXML2.XMLHTTP objects through TestComplete, send a GET request and then evaluate the response code from that.
Now, based upon the example that you noted, you probably could use evidence from the UI, such as if the URL of the resulting page is your error page, validating the text on that error page for the 403 error, etc. These would be evidence through the UI that would indicate what response code you're using. But when it comes to the actual low-level HTTP protocol Request/Response, you're best bet is to utilize the native XMLHTTP object.