VSTS Automated Load Testing Cloud Based Agent – On Premises


I know this title may cause you your head to spin if you’re not working this daily. but .. let us get to the details .
Microsoft Visual Studio Team Services  VSTS (formerly known as VSO Visual Studio online ) and future known as (Visual Studio …..)  is a wonderful collection of tools that run hosted as a SaaS offering ,delivering most of the tooling that you would get within your local Visual Studio IDE.  — [PS I love VS ]

VSTS offers , CI/CD cycle as most of online ALM tooling products.

The most common build cycle / pipeline did not have running load tests for the longest time. now we are blessed to have this most recent addition to the list of tools.  Yay….

The client I am working for now , decided to use this feature, but as with all corporate minded IT they do not want to execute build on SaaS or PaaS machines, they want to build on own custom built agents and custom build on-premises  . Microsoft has an App for that !!!

The problem :

Webtest with data bound calls to local data source ( like CSV files and other tabular flat files) fail to execute with the following error message.

2018-07-24T20:10:56.1174689Z ##[warning]Could not run load test ‘myTEST’ on agent ‘MyCLTAgentAPP02’: Could not access table ‘MyTableData#csv’ in data source ‘MyTableData’ of test ‘mywebtest,0df341b5a5-ddb6-43dc-8f75-36583bcd77fd’: The Microsoft Jet database engine could not find the object ‘MyTableData.csv’. Make sure the object exists and that you spell its name and the path name correctly.

The error points that the correct location of the file is C:\Windows\System32\MyTableData.csv      which is not correct.

 

The Solution :

  1. First understand how this runs when you invoke it from your Visual Studio IDE.
  2. VS bundles the folder structure you have on your scaffold project into a single flat folder with all the files in it at one single location ( means you need to have a very good naming convention to keep files from overwriting each other).
  3. The Files on your VS project mus be labeled ( Alway Copy ) as a “Copy Output Directory” property.
  4. include the .testsettings files into your project and make sure they are copied as well.
  5. Within your build cycle use the VSTS native [FILE COPY]  task  to copy the test folder
  6. check the “Flatten Folders” Under advanced settings

the rest should be as documented online .

Here is what flatten folders do

C:\MySolution\vsts.runsettings

 C:\MySolution\WebTest\MyWebTest.webtest

 C:\MySolution\loadTests\MyLoadTest.loadtest

 C:\MySolution\TestData\MyTable.csv

 

After flattening this it will be

C:\MySolution\vsts.runsettings

C:\MySolution\MyWebTest.webtest

C:\MySolution\MyLoadTest.loadtest

C:\MySolution\MyTable.csv

 

Happy load testing y’all 🙂 .