views:

496

answers:

2

We are using VSTS 2008 to perform some relatively simple web testing of a web application that we have under development. We have data sources defined to provide input data to the tests, and would like to perform our validations based on this data source also. The problem that I have is the VS GUI does not allow me to bind values in validation rules to a data source.

I have discovered how to convert the test to code, and then update the code to reference the appropriate column in the data source:

validationRule.FindText = this.Context["UsersDataSource.Users#csv.?UserName"].ToString();

However, I can't seem to find the right syntax for entering this into the Properties/Value field of any of the built in Validators, without converting it to code. Has anyone managed to do this, or must I always convert the web tests to code to achieve this?

+1  A: 

Some more analysis shows that there isn't a way to do this through the VS GUI. It can be achieved by converting the test to code, and updating the code to use the data source:

validationRule.FindText = this.Context["UsersDataSource.Users#csv.?UserName"].ToString();

Perhaps in a future version this will be possible via the GUI.

Rhys Jones
A: 

It is possible to do it through the GUI, though admittedly the fix is virtually the same as manually editing the code. If you manually insert the database reference into the validation response field the results will be what you want. This method simply saves the trouble of having to find the lines in the source code to modify, which depending on a user's experience level would make some people less comfortable. I work with a group of testers, who while technically inclined, try to avoid modifying the source directly whenever possible.

ex. for a simple "Find Text" validation type {{boundname.database.column}}