Is it possible to create Selenium tests using the Firefox plugin that use randomly generated values to help do regression tests?
The full story: I would like to help my clients do acceptance testing by providing them with a suite of tests that use some smarts to create random (or at least pseudo-random) values for the database. One of the issues with my Selenium IDE tests at the moment is that they have predefined values - which makes some types of testing problematic.
Right-click the row where the type command is and select Insert new command. Click the new row that is inserted and select store from the Command list. Set the Value field with the variable name you want, such as username . Leave the Target field blank or with a default value.
First off, the Selenium IDE is rather limited, you should consider switching to Selenium RC, which can be driven by Java or Perl or Ruby or some other languages.
Using just Selenium IDE, you can embed JavaScript expressions to derive command parameters. You should be able to type a random number into a text field, for example:
type fieldName javascript{Math.floor(Math.random()*11)}
Update: You can define helper functions in a file called "user-extensions.js". See the Selenium Reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With