locked
Context parameter not found in test context error RRS feed

  • Question

  • Hi,

      I record web tests. They will run fine for some builds. But suddenly one fine day I get the following error. I don't know what is the problem with the date! Status date is a custom calender control which defaults to current business date. When I ran the web test I got the following error

     

    RequestFailed: Context parameter '$HIDDEN1.ctl01$RecordStatusSection$hidOrigStatusDate' not found in test context

     

    I created the coded test and ran the test case then I got the following message

     

    RequestFailed: Exception occurred: The given key was not present in the dictionary.

       at System.ThrowHelper.ThrowKeyNotFoundException()
       at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
       at Microsoft.VisualStudio.TestTools.WebTesting.WebTestContext.get_Item(String key)
       at Functional.AddPersonCoded.<GetRequestEnumerator>d__0.MoveNext() in C:\DAIDS-ES\Development\TestCases\Pegasus\Functional\Persons\AddPersonCoded.cs:line 112
       at Microsoft.VisualStudio.TestTools.WebStress.WebTestCaseVariation.ExecuteNextTopLevelRequest()

     

    line 112 has the following line

    request4Body.FormPostParameters.Add("ctl01$RecordStatusSection$hidOrigStatusDate", this.Context["$HIDDEN1.ctl01$RecordStatusSection$hidOrigStatusDate"].ToString());

     

    I am not sure what's happening. Would someone please help me fix this issue. The only work around that I know is to re record the whole test. I have done this lots of times. All my team has the same issue. We get any error like this we just record the whole test again.

    Santhi.

    Monday, September 10, 2007 3:53 PM

Answers