String mytestvalue = 'N'
// check if it logged us in
if(WebUI.verifyTextPresent("Hello,", false,FailureHandling.CONTINUE_ON_FAILURE)){
mytestvalue = 'Y' //this never sets the value
}
mytestvalue = 'Y' //this sets the value
Even if the “if” statement resolves to true and the code sets mytestvalue = ‘Y’, it still isn’t getting set to ‘Y’.
However, on the following line where I set it (just for testing) it seems to set it fine.
my bad, looks like indeed, the keyword is returning a boolean.
I made the following quick experiment:
WebUI.openBrowser('www.google.ro')
println(WebUI.verifyTextPresent('memento', false))
if (WebUI.verifyTextPresent('memento', false,FailureHandling.CONTINUE_ON_FAILURE)) {
println("I am inside if")
}
println("now i am outside if")
working as expected.
the problem may be just a typo, you are missing a space after ‘if’ (and after the condition too)
my bad, looks like indeed, the keyword is returning a boolean.
I made the following quick experiment:
WebUI.openBrowser('www.google.ro')
println(WebUI.verifyTextPresent(‘memento’, false))
if (WebUI.verifyTextPresent(‘memento’, false,FailureHandling.CONTINUE_ON_FAILURE)) {
println(“I am inside if”)
}
println(“now i am outside if”)
working as expected.
the problem may be just a typo, you are missing a space after 'if' (and after the condition too)