redundant data

2 posts, 0 answers
  1. Shreeraj
    Shreeraj avatar
    1 posts
    Member since:
    Feb 2013

    Posted 25 Feb 2013 Link to this post

    Hey i want to test a web application in which i have to add new user.
    Now when i record the test i fill all the text boxes with its input and new user is created .

    so now when i run this test again the same user get created so there now there are 2 users with same name now as much time i run a test redundant user are been created of same name.

    What i do is, every time i create a user than delete that particular user and than run the test again so there is no data redundancy is there a way where i can run a test with out data redundancy.

  2. Boyan Boev
    Boyan Boev avatar
    1072 posts

    Posted 26 Feb 2013 Link to this post

    Hi Shreeraj,

    Thank you for trying Test Studio.

    There are several possible solutions how to create a different user every time.

    1. Data Driven Testing, it is a testing methodology in which the same sequence of test steps are performed repeatedly using a data source to drive the input values of those steps and/or the values to expect when performing verification steps. 

    You can put as much as you want names in an Excel file or in the local data of the Test Studio. Now it will use a different name on every iteration of the test.

    I recorded a short video as a demonstration.

    2. You can implement a code into a coded step which will generate a random string. Then you can use that string for the name of the user. Here is a sample code:

    Random randomGenerator = new Random();
    string userName = string.Empty;
    letters = "abcdefghijklmnopqrstuvwxyz";
    int maxLetterNumber = letters.Length - 1;
    for(int i = 0; i <= 7; i++)
    userName += letters[randomGenerator.Next(0, maxLetterNumber)];
    Pages.YourApplication.TextBox.Text = userName;

    I recorded another video as a demonstration.

    Hope this helps.

    Boyan Boev
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top