1

I have a website that I need to perform a Load Test on. I tried this with one user logging in and clicking around then logging out. It worked ok but now I need to try with 50 users. Initial user count is 5, increasing by 5 every 20 seconds up to a max user count of 50.

Sessions are managed so I need 50 unique logins, I do have a set of users with associated passwords. I tried doing some searching and I cannot figure out how to get the test to run with the set of users that I have.

Anyone on here have any experience with it?

LearningCSharp
  • 87
  • 1
  • 2
  • 12
  • See http://stackoverflow.com/questions/23649732/how-to-use-a-list-of-values-for-a-parameter/23673194#23673194 – AdrianHHH Jan 08 '15 at 15:34
  • If you run with 50 users then I recommend having many more than 50 unique logins. Twice as many would be reasonable. With equal numbers you are likely to have many logins active for two users at any given time, because of the expected variations in test durations. – AdrianHHH Jan 08 '15 at 15:39

2 Answers2

0

Here's some helpful information considering your question: https://msdn.microsoft.com/en-us/library/dn250793.aspx

It's about using load testing in Visual Studio Ultimate to find performance issues before you release your app.

In Visual Studio Ultimate Trial version, the virtual user count is limited to 250.

QArea
  • 4,955
  • 1
  • 12
  • 22
0

If you want to use exactly as many virtual users as you have user accounts in your test data, you could use a web test plugin like this:

using Microsoft.VisualStudio.TestTools.WebTesting;
using System.ComponentModel;

namespace Plugins
{
    [DisplayName("Lock Data Table Row to Virtual User Id")]
    [Description("Makes each virtual user use the same data row as their user id. "
        + "Only works on first table of first data source. \r\n"
        + "LoadTest > Scenario > Percentage of New Users must be set to 0.")]
    public class LockDataTableRowToVirtualUserIdWebTestPlugin : WebTestPlugin
    {
        public override void PreWebTest(object sender, PreWebTestEventArgs e)
        {
            int id = e.WebTest.Context.WebTestUserId;
            // correct discrepancy (WebTests start at id 1, LoadTests start at id 0)
            if (!e.WebTest.Context.ContainsKey("$LoadTestUserContext")) id -= 1;

            int rows = e.WebTest.GetDataTableRowCount(e.WebTest.DataSources[0].Name, e.WebTest.DataSources[0].Tables[0].Name);
            if (id > rows - 1) // not enough rows
                throw new WebTestException("Not enough rows to provide all users with unique data; id=" + id + " rows=" + rows);

            e.WebTest.MoveDataTableCursor(e.WebTest.DataSources[0].Name, e.WebTest.DataSources[0].Tables[0].Name, id);
        }
    }
}

Requires "Percentage of New Users" setting in the Load Test Scenario properties be set to 0, which keeps the virtual user ids constant for each virtual user. Otherwise, new virtual users will get new ids that exceed the data rows.

Could easily be enhanced to work on named DataSources/DataTables via properties.

agentnega
  • 3,478
  • 1
  • 25
  • 31