variables - Selenium Compare storedVars to Text -
i'm trying compare stored variable (user inputs variable value) predefined text. testing on beta site compared production site. example of code follows:
<tr> <td>store</td> <td>production</td> <td>productionorbeta</td> </tr> <tr> <td>storeeval</td> <td>((storedvars['productionorbeta'] = "beta")?'http://betasite.com/':'http://productionsite.com/')</td> <td>targetwebsite</td> </tr> <tr> <td>open</td> <td>${targetwebsite}</td> <td></td> </tr> <tr> <td>storeeval</td> <td>((${productionorbeta}="beta")?'betalogin':'productionlogin')</td> <td>loginname</td> </tr> <tr> <td>storeeval</td> <td>((${productionorbeta}="beta")?'betapw':'productionpw')</td> <td>loginpassword</td> </tr> i've tried single , double quote, both produce same results. above code seems logical me doesn't seem possible. no matter variable "productionorbeta" holds betasite open.
thank you,
jesse smothermon
i got it. here's code
<tr> <td>store</td> <td>production</td> <td>productionorbeta</td> </tr> <tr> <td>storeeval</td> <td>((storedvars['productionorbeta'] == "beta")?'http://betasite.com/':'http://productionsite.com/')</td> <td>targetwebsite</td> </tr> <tr> <td>open</td> <td>${targetwebsite}</td> <td></td> </tr> <tr> <td>storeeval</td> <td>((storedvars['productionorbeta']=="beta")?'betalogin':'productionlogin')</td> <td>loginname</td> </tr> <tr> <td>storeeval</td> <td>((storedvars['productionorbeta']=="beta")?'betapw':'productionpw')</td> <td>loginpassword</td> </tr> the difference being "storedvars['productionorbeta']" way through , double equals ("==") opposed single equals ("=").
thank you,
jesse smothermon
Comments
Post a Comment