Recording & Populating Form Fields
The UIApp issue that we were having can be attributed to one thing: the test is not grabbing certain hidden form values (such as __EVENTARGUMENT) during runs. During recording, it assigns extraction rules. However, when the tests are then run, it is not always extracting these values that are passed in the POST. No javascript manipulation is taking place. The test simply isn't grabbing the values.
I have found a tool that grabs and shows the entire POST, which allows me to verify that data was present and passed from those fields. It's frustrating that the test does not have the same level of functionality.
At the moment, the test won't even extract a hard coded value for __EVENTARGUMENT. The presence of the field is validated, but no value is extracted.
Is the hidden form field extraction using the same approach for all hidden fields, or are more commonly named fields (such as __VIEWSTATE, which is being handled correctly) handled differently?
One other issue that I've found is that __PAGEARGS was not returned to a parent window when a child window was closed, but elsewhere the test correctly passed __PAGEARGS from screen to screen.
Any suggestions as to a workaround would be appreciated.
[1225 byte] By [
sjc1776] at [2007-12-17]
What version are you using? Beta 2 or the July CTP? All hidden fields are treated the same in post Beta2 builds. I believe the Beta2 build would save __EVENTARGUMENT and __EVENTTARGET into the web test exactly as they were POSTed during recording.
What do you mean the test does not show you the entire POST? The Request tab in the viewer will show you exactly what our engine sent to the web server.
In the Details or Context tab (depending on your build), do you see the hidden fields you need in the context?
Josh
Using the RC build (8.0.50727.26; RTM.050727-2600), the form POST request consistently fails IF it's the first occaison in a test where a new browser window is spawned, even though the preceding GET to the same page succeeds (including the extraction of hidden parameters).
The recorder correctly picks up all expected Form Post Parameters...the POST request just isn't formed correctly when the test is run; the truncated POST that is issued looks like this ("request" tab of results):
"POST HTTP/1.1"
...and that's it (this particular test spawns several more child windows via hyperlinks, and they seem to work just fine, although these are all HTTP GET requests...none are HTTP POST).
The Details tab indicates this exception ("$HIDDEN1.EndpointFilter:RelayGroupsContents" was recorded just fine):
Microsoft.VisualStudio.TestTools.WebTesting.WebTestException: Context parameter '$HIDDEN1.EndpointFilter:RelayGroupsContents' not found in test context
at Microsoft.VisualStudio.TestTools.WebStress.WebTestInstrumentedTransaction.UpdateBindingSites(String preBoundString)
at Microsoft.VisualStudio.TestTools.WebStress.WebTestInstrumentedTransaction.PerformRequestDataBinding()
at Microsoft.VisualStudio.TestTools.WebStress.WebTestInstrumentedTransaction.Execute(WebTestCaseContext testCaseContext, AsyncCallback completionCallback, Object callerState)
Terry,
What that exception means is that your test is looking for a hidden field called EndpointFilter:RelayGroupContents in, most likely, the previous page and it's not being found. It could be because the previous request is failing and the server is returning an error page. Whatever it is, you need to figure out why that field that your test expects to be in the context isn't there. Often, this sort of problem comes down to a single hard-coded form parameter or one with an incorrect value.
Josh