For example, let's say you want to generate a complex random pattern that you cannot obtain by using our
Set Variable action and by concatenating variables and strings.
Web Tests by using an
Extract Value from JS variable option from the
Set Variable action.
You can find more details about the
Set Variableaction and variable concatenation in the Variables chapter.
- Add an
- Save the test.
- Execute the test.
- Do not use the
- Avoid using the
This means that it might not behave in the same way in all browsers and you might need to adapt it.
window.before each variable.
For example, this is how you would import the
s = document.createElement("script");
s.src = "https://chancejs.com/chance.min.js";
And this is how you would call the
phone() method from that library:
phone = chance.phone();