Locked exception in web test plugin

  • Tuesday, March 06, 2012 5:48 AM
     
     

    hi.


    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!

All Replies

  • Tuesday, March 06, 2012 8:41 PM
     
     Proposed Answer

    Hi Syueda,

    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:

    1. Add the same datasource to test1 that you did with test2 and test3.
    2. 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,

    Robert


    http://blogs.msdn.com/rogeorge

  • Thursday, March 08, 2012 2:47 AM
     
     

    hello Robert,

    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
     
     

    Hi Syueda,

    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.


    http://blogs.msdn.com/rogeorge

  • Thursday, March 08, 2012 11:56 PM
     
     

    hello Robert,

    yes i've tried adding the datasource for test1, yet it still giving me errors.

  • Friday, March 09, 2012 3:21 AM
     
     Answered

    Hi Syueda,

    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.


    http://blogs.msdn.com/rogeorge

    • Marked As Answer by syueda Friday, March 09, 2012 7:00 AM
    • Unmarked As Answer by syueda Friday, March 09, 2012 7:00 AM
    • Marked As Answer by syueda Friday, March 09, 2012 7:00 AM
    •  
  • Friday, March 09, 2012 7:02 AM
     
     

    hello Robert,

    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!