Home > ALM, TFS, Uncategorized, Visual Studio > Load Testing: Context parameter ‘$HIDDEN1.__RequestVerificationToken’ not found in test context

Load Testing: Context parameter ‘$HIDDEN1.__RequestVerificationToken’ not found in test context


I was doing load testing using Visual Studio 2013 Ultimate for one of the applications I was working on and I noticed the following error when I try to run the recorded load test

Context parameter ‘$HIDDEN1.__RequestVerificationToken’ not found in test context


Scanario

The test scenario was the following:

  • Load home page
  • Click a url on a page
  • Dialog shows up (GET)
  • Select a value from a dropdown on the dialog (POST)
  • Submit

Cause

The tool was trying to use $Hidden1.__RequestVerificationToken from the main page but that variable wasn’t available in the current context.

Resolution

Add a new Extraction Rule, create new variable at the GET request step above the POST request


Assigned the __RequestVerificationToken value in the form to a Context Parameter


In the Post request, change the form post parameter to new token



That specific request was a POST request done using Ajax.

Advertisements
  1. Sindhu
    July 10, 2015 at 9:02 am

    Hi

    I’ m facing the similar issue. My web test is individually working fine. Only during the load tests I see these errors. but when I tried doing this my web test is failing. Please advise.

    Thanks

    • Lajak Technologies Inc
      July 10, 2015 at 9:26 am

      What is the error in you we test?

  2. Sindhu
    July 10, 2015 at 10:58 am

    I’ m seeing this error ‘Object reference not set to an instance of an object’ in the web test.

    • Lajak Technologies Inc
      July 10, 2015 at 6:32 pm

      Can you send me the project? Or a video of the problem.

  3. Sindhu
    July 14, 2015 at 9:54 am

    I have a question. Here ‘_RequestVerificationToken’ is a hidden field. Then why do we add a rule for extracting form fields and why not for extracting hidden feilds

    • Lajak Technologies Inc
      July 14, 2015 at 5:53 pm

      Yes you can. I just wanted to keep it simple. I am planning to write another post to show how to capture hidden fields. The trick is the tool will prefix the name with “HIDDEN”. For example if you name it “x”, you need to reference it as HIDDENx._RequestVerificationToken’

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: