如何将变量与硒中的空白值进行比较?

时间:2012-07-11 07:59:41

标签: selenium-ide

我想检查变量是否存储空值。 我尝试将它与''或'“或NULL或null进行比较,但不起作用。

2 个答案:

答案 0 :(得分:1)

您可以尝试以下解决方案

storeValue  |  element  |  test
store       |           |  j  (blank value)
gotoIf      |  storedVars['test']==storedVars['j']  |  true
getEval     |  alert("test Variable Value is not blank")
gotolabel   |  finish
label       |  true
getEval     |  alert("test Variable Value is blank")
label       |  finish

答案 1 :(得分:0)

您也可以使用verifyEval命令。请尝试以下脚本,

  

verifyEval | this.page()。findElement(“id = gbqfq”)。value ==''|真

相关问题