verifyTextPresent() - Text is not present on page

Hi guys, I’m trying to test the last step of my test case verifying the success text after clicking on continue button but the words are not being found in the page, its always on the same windows with the same URL'Page/button_Continue'))

WebUI.verifyTextPresent('Check your inbox', false, FailureHandling.STOP_ON_FAILURE)


Screenshoot of the page:

(I have tried with the first words of the paragraph below the title but with the same results)


2019-07-19 00:53:13.295 DEBUG testcase.2. Create a new buyer
20: click(findTestObject(“Page/button_Continue”))
2019-07-19 00:53:13.454 DEBUG testcase.2. Create a new buyer
21: verifyTextPresent(“Check your inbox”, false, STOP_ON_FAILURE)

2019-07-19 00:53:14.548 ERROR c.k.k.core.keyword.internal.KeywordMain - :x: Text ‘Check your inbox’ is not present on page (Root cause: com.kms.katalon.core.exception.StepFailedException: Text ‘Check your inbox’ is not present on page
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.builtin.VerifyTextPresentKeyword$_verifyTextPresent_closure1.doCall(VerifyTextPresentKeyword.groovy:79)
at com.kms.katalon.core.webui.keyword.builtin.VerifyTextPresentKeyword$
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
at com.kms.katalon.core.webui.keyword.builtin.VerifyTextPresentKeyword.verifyTextPresent(VerifyTextPresentKeyword.groovy:83)
at com.kms.katalon.core.webui.keyword.builtin.VerifyTextPresentKeyword.execute(VerifyTextPresentKeyword.groovy:68)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyTextPresent(WebUiBuiltInKeywords.groovy:1677)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$verifyTextPresent$ Source)
at 2. Create a new Create a new buyer:57)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(
at com.kms.katalon.core.main.TestCaseExecutor.runScript(
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(
at com.kms.katalon.core.main.TestCaseExecutor.execute(
at com.kms.katalon.core.main.TestCaseMain.runTestCase(
at com.kms.katalon.core.main.TestCaseMain.runTestCase(
at com.kms.katalon.core.main.TestCaseMain$runTestCase$ Source)

1 Like

Firstly, that’s a superb problem report - it’s not often a new user provides such detailed info. Well done!

Looking at the issue, I’m going to take a guess that there’s a delay before that text appears after you’ve clicked the button. If that’s true, try waiting for the DIV element to be visible first (there is no waitForTextPresent in the WebUI API set AFAIK).

If you still get issues, to prove this is indeed a timing issue, try a fixed delay (couple seconds should be plenty) then try to verify it’s present.

Thanks @Russ_Thomas for the acomplish

Yeap I tried the action waitForPageLoad() and set some seconds into it but still same issue. Also, I have tried the action SwitchWindowsIndex(0) cause I have another test that verify correctly the text I setup but in that case opens in other windows (is not the case here cause is on the same windows)

I will try that! I have to add DIV element as an object in my repository and then use the action WaitForElementPresent() and/or verifyForElementPresent(), right?

Try waitForElementVisible (it will also prove it is present at the same time).

waitForPageLoad is a good idea, but it doesn’t help with individual elements. The page may be loaded, but the browser still needs time to build the elements on the page. You can think of waitForPageLoad as waiting for the HTML, JavaScript and CSS to be loaded – but it does not mean the browser/page is “ready” for use.

@Russ_Thomas seems to be working great now!

I still don’t catch why I have to save that div as an element to be able to find it on the page (after I wait for more than 10 seconds to the page loads) by the way thanks for the helpmate.

This was my solution'Page/button_Continue'))

    action=WebUI.waitForElementPresent(findTestObject('Page/email confirmation -we ve sent a message'), 3, FailureHandling.STOP_ON_FAILURE)



I use a variable there only to be sure that the element has been found but I suppose is unnecessary using the FailureHanding

1 Like


I’ve unmarked your solution because it does not provide a solution to the problem as originally stated.