Tuesday 4 September 2012

Compare a variable with blank value in selenium



To compare variable with blank value, you can try solution like suggested      below - 
Here 'test' and 'j' are two variable. j having blank value.
It will compare 'test' and 'j' variable and accordingly it will display message  whether test variable is blank or not.


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


No comments:

Post a Comment