There are times when your web test may fail with a 404 error in a dependent request (like a css file or gif), but you may not actually care about this error. For example, it may be something that doesn't really impact the layout or content of the page. Or you might file a bug and temporarily want to suppress the error until it is fixed so they can find other errors.

If you get a 404 error in a dependent resource, here's how you can mask it.

Here's a failing web test, it is very simple. If I expand the top request I can see it is failing due to a failed dependent request.

image

To mask the request, right-click on the dependent and hit Copy.

Go to the test, right click on the corresponding request in the test and select "Add Dependent Request". Paste the url on the clipboard into the url property for the dependent request:

image

Now set the expected http status code on the dependent to 404.

image

Rerun the test to see it pass.

image

Hope that helps,

Ed.