Adding Two Variables to Selenium IDE

I have one value in one variable and the second in another, now I want to add these two numbers. I can not do this, I tried using the code below, but its not working

<tr> <td>store</td> <td>6</td> <td>w</td> </tr> <tr> <td>store</td> <td>6</td> <td>x</td> </tr> <tr> <td>store</td> <td>javascript{storedVars['w'] + storedVars['x']}</td> <td>z</td> </tr> <tr> <td>echo</td> <td>${z}</td> <td></td> </tr> 
+4
source share
2 answers

You must use the storeEval command

 <tr> <td>storeEval</td> <td>${w}+${x}</td> <td>z</td> </tr> 
+8
source

Be sure to add quotation marks around the variables ...

So:

 <tr> <td>storeEval</td> <td>&quot;${w}&quot;+&quot;${x}&quot;</td> <td>z</td> </tr> 

You can see some annoying colon-related errors if you don't! Hooray!

0
source

Source: https://habr.com/ru/post/1399320/


All Articles