I would create a web test that uses only one login to login. Then you can create a small piece of code in a web test to get a "random" login from the database, a list in the code to select a login.
If you need a unique login for each test, you will need to evaluate how many logins are required and re-fill it.
, , .
, , .
, , , .
public static bool GetNextLogin(out string userName, out string password)
{
bool result = false;
using (SqlConnection connection = new SqlConnection(loadTestLoginsConnection))
{
using (SqlCommand command = new SqlCommand("GetNextID", connection))
{
connection.Open();
using (SqlDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
userName = reader["UserName"].ToString().Trim();
password = reader["Password"].ToString().Trim();
result = true;
}
}
}
}
return result;
}
, post. , WebTest.UserName WebTest.Password.
int CurrentLoginID
BEGIN TRANSACTION
BEGIN TRY
DECLARE @CurrentID AS INT
UPDATE CurrentLoginID SET Number = Number+1
SELECT @CurrentID = Number FROM CurrentLoginID
SELECT [Password], UserName FROM AvailableLogins WHERE AvailableLogins.ID = @CurrentID
COMMIT
END TRY
BEGIN CATCH
DECLARE @ErrorMessage NVARCHAR(4000);
DECLARE @ErrorSeverity INT;
DECLARE @ErrorState INT;
SELECT
@ErrorMessage = ERROR_MESSAGE(),
@ErrorSeverity = ERROR_SEVERITY(),
@ErrorState = ERROR_STATE();
RAISERROR (@ErrorMessage,
@ErrorSeverity,
@ErrorState
);
ROLLBACK TRAN
END CATCH