Tag Archive for 'load testing'

How to abort load test when its scenario fails?

By definition a load test is supposed to simulate many users accessing a server at the same time. It consists of series of iterations, which can be either Web tests or unit tests. Each operation is repeated the defined number of times for each virtual user.

A load test completes with status ‘Completed’. If one needs to learn more details on the run, they should open the result file (trx) and read the statistics. Now, in real world something can go wrong with either the infrastructure or one of the system components. Let’s say that one of the element in a long Web test fails for a reason. In such case you would rather not wasting time analyzing the result of the test to find it out only ten, but write it off automatically.

Continue reading ‘How to abort load test when its scenario fails?’

LoadTest: MethodAccessException Microsoft.VisualStudio.TestTools.WebTesting.WebTest.set_Outcome

I had a load test that used a coded web test. At some point the coded web test changed, i.e. this line was added: Outcome = Outcome.Fail;.

After this change the test stopped working – it always ended with error message: ‘User aborted test run’. Apart from that each iteration of the web test produced MethodAccessException: Microsoft.VisualStudio.TestTools.WebTesting.WebTest.set_Outcome(Microsoft.VisualStudio.TestTools.WebTesting.Outcome).

Solution

The reason for the problem was I was using Visual Studio TS 2008 without SP1. Once I installed the SP1, which must have updated mstest, the test started running successfully again.

The key point here is before SP1 Outcome was read-only property, which I learned there.

Is it possible to fail a load test?

It’s not really possible to fail a load test because by default it always ends with status ‘Completed’. Because of that anytime a load test completes one musts analyze the results – if performance stayed at the acceptable level. So, despite being a powerful tool, load tests require human attention, which makes the whole testing process less automate.

Continue reading ‘Is it possible to fail a load test?’

Load Test – Plug-In class not found

I wanted to change a load test so that it works similar to what Gabriel Szlechtman described in his blog. Additionally, I followed MSDN instruction on how to create a Load Test Plug-In.

So I created a new project with a plug-in class, added a reference to it from load test project and wanted to hook the plug-in with the test. However, when I was doing the last step I was getting the following error:

pluginclassnotfound Load Test   Plug In class not found

Solution

The fix is quite simple. When I added a new class for the plug-in, it was defined without the access modifier (and therefore it was internal), which made the class accessible from other classes only in the same assembly. Adding public access modifier for the plug-in class solved the problem.

Could not access the result repository: Invalid object name ‘LoadTestRun’

When I ran a load test on my environment (Visual Studio TS 2008) for the first time I got the following error:

Error occurred running test. XXX could not access the result repository: Invalid object name ‘LoadTestRun’

Solution

The reason for that was I hadn’t had created a database schema for load tests. In order to do it I executed <VS location>\Common7\IDE\loadtestresultsrepository.sql which did all the job.

Please refer to msdn for more information.