Can we generate unique distinct users for parallel tests in selenium?



  • Can we generate unique distinct users for parallel tests in selenium WebDriver and java?

    Suppose, in google create an account action I want to pass firstname, Lastname, Username & Password for different browsers.
    I was written script & when it was tried to run in parallelly on IE, Safari, FF & Chrome, It successfully runs on the single browser but for the 2nd browser, it shows for email Id -"Email already exists".
    This is right because we never create more accounts with the same ID.

    Now my question is:

    How to pass different inputs (strings) in same field textbox for different browsers to create an account.

    Suppose If we set an array with 4 input strings. should we take a random value from this array for different browsers?

    an array of multiple inputs  
    -Email1  
    -Email2  
    -Email3  
    -Email4  
    

    when we run the script in parallelly- for the first browser it should take Email1 -When the same script will run for the 2nd browser it should take email2 ..same for 3rd & 4th. Is it possible in Selenium with java? If Yes, How?

    Your answer is highly appreciated.



  • So what you are trying to do is have a script run on different browsers and want to register a user with a unique email address.

    Well, Google allows you to use single email address for such testing purposes with incremental characters appended to your ID. How this works is,

    You have a Gmail account say example@gmail.com. You can use this same account for testing purpose and register different unique users by appending "+" followed a character, string or number and then rest of the address (@gmail.com). For example, example+1@gmail.com example+2@gmail.com ... example+n@gmail.com

    All the email conversations for each of these regisered user will go to example@gmail.com, but the name and email will be the respective test account.

    Now, what you need to do is have a array of various email addresses in the format explained above.

    OR

    Write a loop to generate such email addresses with incremental numbers appended to the ID.

    Then, you can pass a different email address for each browser instance using a loop, or a conditional check. You can do something like,

    if(browser is FF) { pass example+1@gmail.com }

    if(browser is IE) { pass example+2@gmail.com }

    if(browser is Chrome) { pass example+3@gmail.com }

    You can also have a loop that will rotate the browsers and at the same time generate a unique auto increment email and register a user. Some thing like,

    for(i=0;i


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2