I'd like to know how you can automate the registration process for a site that requires a unique email address or username each time, using Selenium IDE. My only thought would be to insert an appropriately formatted random string into the username or email field; this could be done easily with the Python or Java version of the test case code, but what about in the initial Selenium Core syntax?
|
I normally just record all the steps then prefeace with some JS where i need it.. like...
Works best if you have a catch-all address configured for testing @domain.com.. Quick and dirty but does the job, and points dev's in the right direction for when they compile more re-usable test cases or add it to a framework.. |
|||||||||||
|
|
your other option is to have some code that removes the user you created (perhaps by talking directly to the database) after the test scenario itself is complete. In a lot of frameworks it's possible to define code to run before or after each test. So for the set of tests that don't cover the 'email already in system' cases, you could have them either being sure that there is no user already in the system that uses that email, before the test runs, or removing it after. either one should work.. Generally I'd prefer my tests to always clean up after themselves, but sometimes it's hard to have that happen reliably. |
|||
|
|
|
If you want to actually receive an email (and you have a gmail account) with each test run, you can use something like this:
This is a variation of one of the answers for Stackoverflow Question. |
||||
|
|