UIApp Revisited

Back to the UIApp hidden field. Apparently, the real issue is that it needs to be grabbed in real time. A user fills out a form and submits it to create a new application. After submission, UIApp is created by the server, supplied with a value and is sent client-side with the next web page. That page is created client-side referencing UIApp.

So far during web testing, I have to supply a static value into the test for the first appearance of UIApp and the subsequent pages access and alter UIApp without a problem. However, the content is basically static. The test is retreading over a previously created application.

The tests seem to rely on data pulled from the previous web page, but my developers tell me that I need UIApp (and perhaps other information) real time.

So, being a tester and not a strong programmer, I have gathered that the web test will POST the page, then add recorded/supplied data to form fields and lastly extract hidden values for use on the next page. My limited programming skills have not led me to how to tweak the test to submit the form, POST the next web page, grab the newly creately UIApp value immediately, then add data to the form fields including UIApp. This is the only way that the web tests will be dynamic, create/edit applications and fully test our app and db.

I appreciate any guidance (or examples) a developer can supply.

[1390 byte] By [sjc1776] at [2007-12-16]
# 1
The default as you say is for web tests to extract the hidden field value from the page and post the value that was extracted.

This default behavior will not work if your test has client-side java script that modifies the hidden field value (is that the case?). If you are using a declarative web test you will need to write a pre-request callback in a web test plugin to modify the hidden field value appropriately. I believe there is a walkthrough for creating a validation rule in the beta docs. You can follow this to get started, but instead of implementing the IValidationRule interface in your class, implement the IWebTestPlugin interface. The PreRequest method in this interface is called for every request, so you'll have to check for

You can debug this code by running the web test under the debugger. Just set a breakpoint in the code, right-click the web test in Test View, and select Run in Debugger.

The other approach is to convert your web test to a coded web test and do this in code.

Hope that helps,

Ed.

EdGlas at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...

Visual Studio Team System

Site Classified