This is not necessary by the way, just a possible improvement.  isTextPresent is not ideal because it looks everywhere on the page, but practically it should work fine if the text is unique.