user2040718
user2040718

Reputation: 1

Selenium verify randomly generated email

I am building test cases for a particular website, where I need Selenium to fill out a registration form, Ive got it all set up, however my only issue is getting it to "Verify" the random email it entered in the original "Email" field.

I have everything else working but since I am somewhat of a noob at all this (Im just game Automation QA that needs to work on some website test cases) I am somewhat in over my head

javascript{'Username+'+Math.floor(Math.random()*100000)+'@gmail.com'}

This is the code I am using to generate the random email (and usernames)

So, pretty much, id like to know if its possible to store that email to use it in another field of the form I need it to fill in.

Thanks

Upvotes: 0

Views: 1786

Answers (1)

Stephen Ostermiller
Stephen Ostermiller

Reputation: 25524

You can use the Selenium store method to store that email address and then use it later.

store    javascript{'Username+'+Math.floor(Math.random()*100000)+'@gmail.com'}    random_email

And then you can later use it like this

verifyText    //span[@id=email]    ${random_email}

Here is the selenium reference about variables: http://docs.seleniumhq.org/docs/02_selenium_ide.jsp#store-commands-and-selenium-variables

Upvotes: 1

Related Questions