0

I'm trying to verify if there is text inside an element. If there is text inside this element I want it to gotolabel and if there isn't any text want to to continue on. How can i go about doing this?

I've tried to verifyText | id=note | (i don't know how to make it search for ANY word)

But I don't know how to make it search for ANY text and make it skip to a label once it does find a text.

EDIT: I changed verifyText with verifyElementPresent | id=note |. If the element is present that means that there is text.

Now I'm stuck again. How can i make a

if | verifyElementPresent == true |

gotolabel | start |

kind of statement possible?

1 Answers1

1

Have you tried the regex match with *?

Something like the following should work according to the SeleniumIDE doc

verifyText | id=note | *Text to match*
Saifur
  • 16,081
  • 6
  • 49
  • 73
  • I'm trying a different method now. How can I make an if statement with the true/false result of a `verifyElementPresent`? – ItsSuperNinja May 09 '15 at 18:54
  • No I did not. I don't understand it and I have been stuck on this problem for a few hours so I tried a different way of solving it. I re read what you said but I still don't understand it :( – ItsSuperNinja May 09 '15 at 19:12
  • The asterisk allows you to exclude text before and text after. Such as if the sentence is **This is text to find** and you use \*text\* it should return true since it's a partial match with regular expression. See the link I provided to the answer for more option – Saifur May 09 '15 at 19:34
  • Ahh okay I understand now. The thing now is how could I use the true/false from verifyText command to do an if statement like in the edit i made? – ItsSuperNinja May 09 '15 at 19:43
  • There is no easy way. For any deep programming and testing purpose Selenium WebDriver is best fit. Someone else already faced that problem. See [this](http://stackoverflow.com/questions/11275354/using-if-else-in-selenium-ide) answer. – Saifur May 09 '15 at 19:46