Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling ExpectedResponseUrl for single request in web test

I'm recording a web test using Visual Studio 2010.

For each request, the expected response url is recorded, and a validation rule on the test ensure that these response are correct.

The test is using random data. For a particular request, in certain case the response url may differ from what is recorded, and the test is still valid. I can handle an action depending on the response url in a WebTestRequestPlugin, but the validation rule still applies.

I tried removing the response url in the properties tab for that request, but if the field is empty, the validation rule seems to expect the same url as the request for the response.

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

[Edit] I just think that being able to put wildcards in the ExpectedResponseUrl field for the request would be great... but that does not seems to work with a "*". [/Edit]

like image 601
Johnny5 Avatar asked Feb 18 '11 19:02

Johnny5


3 Answers

Try converting the test to a coded test. Then you can either write a small piece of code so the expected url will be correct, or override the validator.

You could create a custom Validation rule if you want to avoid coding the test.

like image 163
Nat Avatar answered Sep 18 '22 02:09

Nat


You can effectively remove the Response URL validator on a single request as follows:

  1. In the context (right click) menu of the web test, select "Extract web test".
  2. Make sure the desired first and last requests are selected, then follow the prompts.
  3. Upon completion of prompts: The selected requests are moved into another ".webtest" file and a call of that file is automatically added to your parent webtest.
  4. Open the newly extracted web test file in Visual Studio and delete its Response URL validator.
like image 26
AdrianHHH Avatar answered Sep 19 '22 02:09

AdrianHHH


Just simply remove the Response URL rule which is added by default under validation rules. This will pass your tests and if you need to test the URLs, you can always add custom validation rules.

like image 28
user3411471 Avatar answered Sep 20 '22 02:09

user3411471