Selenium将storedVars与Text进行比较

时间:2011-07-01 23:31:22

标签: variables selenium comparison

1 个答案:

答案 0 :(得分:1)

我明白了。这是代码

<tr>
    <td>store</td>
    <td>Production</td>
    <td>ProductionOrBeta</td>
</tr>
<tr>
    <td>storeEval</td>
    <td>((storedVars['ProductionOrBeta'] == &quot;Beta&quot;)?'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']==&quot;Beta&quot;)?'betalogin':'productionlogin')</td>
    <td>loginName</td>
</tr>
<tr>
    <td>storeEval</td>
    <td>((storedVars['ProductionOrBeta']==&quot;Beta&quot;)?'betapw':'productionpw')</td>
    <td>loginPassword</td>
</tr>

区别在于“storedVars ['ProductionOrBeta']”一直通过和双等于(“==”)而不是单个等于(“=”)。

谢谢,

Jesse Smothermon