Disabling ExpectedResponseUrl for a single request in a web test

I am recording a web test using Visual Studio 2010.

For each request, the expected response URL is recorded, and the validation check rule ensures that the response is correct.

The test uses random data. For a specific request, in a specific case, the response URL may be different from what is recorded, and the test is still valid. I can handle the action depending on the response URL in WebTestRequestPlugin, but the validation rule still applies.

I tried to remove the response URL in the properties tab for this request, but if the field is blank, the validation rule seems to expect the same URL as the response request.

Is there a way to disable this validation rule for this single request?

[Edit] I just think that the ability to set wildcards in the ExpectedResponseUrl field for the request will be great ... but this does not seem to work with "*". [/ Edit]

+6
visual-studio-2010 webtest
source share
3 answers

Try converting the test to an encoded test. You can then write a small piece of code so that the expected URL is correct or overrides the validator.

You can create a custom validation rule if you want to avoid test coding.

+7
source share

You can effectively remove the validator of the response URL for a single request as follows:

  • In the context menu (right-click) of the web test, select "Extract Web Test".
  • Be sure to select the required first and last queries, then follow the instructions.
  • At the conclusion of the requests: the selected requests are transferred to another ".webtest" file, and a call to this file is automatically added to your parent website.
  • Open the newly extracted web test file in Visual Studio and remove its response URL validator.
+4
source share

Just remove the response URL rule, which is added by default according to the validation rules. This will run your tests, and if you need to verify the URLs, you can always add special validation rules.

+2
source share

All Articles