javascript - How to get array item in Selenium IDE and use it? -


this code

<tr>     <td>storeeval</td>     <td>new array ('cat','dog')</td>     <td>names</td> </tr> <tr>     <td>storeeval</td>     <td>javascript{storedvars['names'].length}</td>     <td>length</td> </tr> <tr>     <td>storeeval</td>     <td>math.floor((math.random()*storedvars['length'])+0)</td>     <td>rn</td> </tr> 

and here doesnt work:

<tr>     <td>type</td>     <td>name=productname[2]</td>     <td>javascript{names['1']}</td> </tr> 

this doesnt work (i want use random item here):

<tr>     <td>type</td>     <td>name=productname[1]</td>     <td>javascript{names[storedvars['rn']]}</td> </tr> 

try this. <tr>     <td>storeeval</td>     <td>new array ('cat','dog')</td>     <td>names</td> </tr> <tr>     <td>storeeval</td>     <td>javascript{storedvars['names'].length}</td>     <td>length</td> </tr> <tr>     <td>store</td>     <td>javascript{math.floor(math.random()*storedvars['length'])}</td>     <td>num</td> </tr>  adding values normaly  <tr>     <td>type</td>     <td>name=productname[2]</td>     <<td>javascript{storedvars['names'][0]}</td> </tr>  adding values randomly <tr>     <td>type</td>       <td>name=productname[2]</td>     <<td>javascript{storedvars['names'][storedvars.num]}</td> </tr> 

thank you.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -