I’m a Selenium n00b… it’s clear how easy it is to run a test and verify a particular response, but how can I take a value from one response and use it in the next test?
an example might be a contact creation form…
- type in name/email and click submit
- response arrives with new ContactID
- grab the ContactID that was returned and put it into “get” textbox and click “submit”
- response arrives with contact details
- verfy the name/email match the first set
how might I go about doing this in Selenium?
And now something completely different:
Now I understand when you say “test”, you mean a single assertion within one test case. So you want to use a value returned from a request as input for another request in the same test case.
Assuming you use selenium ide: To do this, use one of the “store…” commands in selenium ide and store the value into a variable. The contactID can be found using a matching selector with the storeText command. For example:
Then, use variable substitution and the type command to insert that text somewhere else.
Hope this helps 🙂