Running a terminate test after every web test RRS feed

  • Question

  • Hey, so I have a series of tests that run in sequence within a loadtest definition:





    Additionally, I have a test which is normally called as the Terminate test in a scenario:


    Ultimately I need the system to behave the following way when running through this definition:

    With a single user:

    1. Run Test A

    2. Execute User_Logout

    3. Run Test B

    4. Execute User_Logout

    5. Run Test C

    6. Execute User_Logout

    7. Run Test D

    8. Execute User_Logout

    The reason I'm using a loadtest definition for this is that Test A - D are web performance tests, and need to run against the same test rig as any other multi user load test, the only difference is that in this case the tests are run one at a time in sequence.

    However, setting the User_Logout test as the Terminate test only runs it when the Virtual User is new. And since VS load testing wants to reuse the virtual user, this isn't working and is causing problems due to the nature of the app I'm testing.

    Is there any way to have User_Logout called without modifying individual tests to include that call? Is there any way to have the Terminate test called after every individual web performance test in a scenario?

    Thursday, August 27, 2015 1:25 PM

All replies

  • The "Percentage of new users" can be set to 100% in the properties of the scenario.



    Thursday, August 27, 2015 2:25 PM
  • I've actually tried that already. Setting the Percentage of new users to 100% doesn't cause the "Terminate" test to be fired after each completed test. I'm really not sure what it does, to be honest. Maybe adding something to the header?

    In our tests we do have an IF that uses the Me.Context.IsNewUser property, though:

                If Me.Context.IsNewUser Then
                End If

    However this isn't actually what we need, and I'd rather not make a code change to each of our tests to call the LogOut test (which does more than the above code) if I don't have to.

    Thursday, August 27, 2015 2:38 PM
  • The percentage of new users has worked well for my tests, but I did wonder whether it would work when the test mix is set to "...sequential test order". Do your tests need to run strictly in order A-B-C-D ?

    You might try other test mixes and for each look at the "Detail" section of the load test results. This blog explains the output and has a section on "The Effect of Percentage of New Users". See

    The first picture on this page shows a test run with the percentage of new users set to 100%. See



    Thursday, August 27, 2015 3:46 PM
  • Good question! Ultimately each test only needs to run once. The order is actually important since some tests need to be run before others (for example, we have a test that has a user log in and prepare a queue of things that another user will act on). I can't really use other test mixes to do this (not without having a different scenario for each individual test, which would get cumbersome), but I'll keep experimenting. It doesn't look like % of new users set to 100% will result in a new virtual user being used for each test, which is what would trigger the LogOut terminate test.

    Thursday, August 27, 2015 4:54 PM
  • Hi Sean,

    What’s test mix mode that you used?



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 31, 2015 2:14 AM