Tuesday, March 06, 2012 5:48 AM
i've tried implementing codes to reload data source in my web tests from this link --> http://blogs.msdn.com/b/slumley/archive/2010/01/04/vsts-2010-feature-data-source-enhancements.aspx
i have three web tests - test1, test2, test3.
i created 2 plugins to reload data source for each test2 and test3. when i run these three tests as load test separately (single load test run for test1, single run for test2, single run for test3) all three load tests are running okay, no errors come out. the problem arise when i combined these 3 tests into one load test scenario - it starts giving me errors. and one of the errors is that "ReloadDataTable failed: The data source xxx in Web test 'test1' does not contain a table with the name 'yyy'"
but, there's no plugin written for test1 at the first place. so why the exception pointing this test1 as having error in reloading data? the error mentioned data source from any of the other two tests, but it's pointing to the wrong web test.
i'm not sure if i made any sense, but this is the problem i'm facing. appreciate if anyone could shed some light on this. thanks!
Tuesday, March 06, 2012 8:41 PM
The issue you describe seems to repro for me as well so I would advise Submit this as a bug by Browse to http://connect.microsoft.com/VisualStudio/feedback .
Now for the workaround:
- Add the same datasource to test1 that you did with test2 and test3.
- Very important, even though your not using it in test1, it needs to be bound properly so to make sure, you need to set the property under the data source Tables called Select Columns to "Select All Columns". If you do this it should no longer throw the error and still work the way you need it to.
Hope this helps you out,
- Proposed As Answer by Vicky SongModerator Wednesday, March 07, 2012 2:44 AM
Thursday, March 08, 2012 2:47 AM
thanks for the reply and suggested workaround.
but i need to verify with you on step 1;
Add the same datasource to test1 that you did with test2 and test3.
does this means that i need to add the same datasource for test1, i mean is it the same datasource that i've added for test2 and test3? what if test1 doesnt have any datasource (test1 doesnt need data binding)?
hope you can help clarify on this one, thanks :)
Thursday, March 08, 2012 3:10 PM
Its a workaround, your making it so each of your tests has the datasource even though your not using it explicitly, thats the workaround. As I said make sure when you do add the datasource to test1 you must specify "Select All Columns" or it will still error on you.
Thursday, March 08, 2012 11:56 PM
yes i've tried adding the datasource for test1, yet it still giving me errors.
Friday, March 09, 2012 3:21 AM
In the repro I did, I had WebTest1 and WebTest2. WebTest1 had a datasource with a binding in a url property and a plugin that used the WebTest.ReloadDataTable() method. WebTest2 did not have any datasources. I ran a loadtest with the 2 webtests, and got the same error you reported. I suspect that the ReloadDataTable is blowing up because its attempting to udpate the Datasources in all webtests, and finds a nullref in WebTest2 because it doesnt have a datasource. So, I copied the datasource from WebTest1, and pasted it into WebTest2 and did not have any binding to it in webtest2, which I suspected would fail, and it did when I ran the loadtest, because a datasource with no bindings will not have any values populated when you run the test. So, I cannot stress how important this is, I then changed the Select Columns property on the datasource to Select All Columns, which means that the datasource will be bound to the test despite having any explicit binding in the request properties. Now when I ran it that time, it ran perfectly, and of course since WebTest2 is not using the datasource anywhere it doesnt hurt that test at all.
I hope this post helps you to get past the errors, I put all the details I could think of to explain what I did. If you try these steps and it still does not work, I would advise you to open a support case and work though that way.
Friday, March 09, 2012 7:02 AM
now i get it, the same datasource needs to be added for every web test. previously i only added the datasource for test1, hence it doesnt work for me. today i added the datasources to each and every test i have, and the errors are not generated :)
thanks a lot for your help!