If a step fails within a test case that is being called by another test case, it display an "Unable to call test case" error.

If a step fails within a test case that is being called by another test case, it display an “Unable to call test case” error.

Unable to call Test Case ‘Test Cases/Login/Functional TestCases/Verify fields are Mandatory’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Call Test Case ‘Test Cases/Login/Functional TestCases/Verify fields are Mandatory’ failed
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:63)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.call(CallTestCaseKeyword.groovy)
at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:74)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.callTestCase(CallTestCaseKeyword.groovy:81)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.execute(CallTestCaseKeyword.groovy:44)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
at com.kms.katalon.core.keyword.BuiltinKeywords.callTestCase(BuiltinKeywords.groovy:350)
at ValidLogin.run(ValidLogin:30)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:448)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:142)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:133)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1678647893939.run(TempTestCase1678647893939.groovy:25)
Caused by: com.kms.katalon.core.exception.StepFailedException: Object ‘Object Repository/Login Page/errorMessages’ is visible (Root cause: com.kms.katalon.core.exception.StepFailedException: Object ‘Object Repository/Login Page/errorMessages’ is visible
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.builtin.VerifyElementNotVisibleKeyword$_verifyElementNotVisible_closure1.doCall(VerifyElementNotVisibleKeyword.groovy:83)
at com.kms.katalon.core.webui.keyword.builtin.VerifyElementNotVisibleKeyword$_verifyElementNotVisible_closure1.call(VerifyElementNotVisibleKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
at com.kms.katalon.core.webui.keyword.builtin.VerifyElementNotVisibleKeyword.verifyElementNotVisible(VerifyElementNotVisibleKeyword.groovy:97)
at com.kms.katalon.core.webui.keyword.builtin.VerifyElementNotVisibleKeyword.execute(VerifyElementNotVisibleKeyword.groovy:67)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyElementNotVisible(WebUiBuiltInKeywords.groovy:391)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$verifyElementNotVisible$7.call(Unknown Source)
at Verify fields are Mandatory.run(Verify fields are Mandatory:54)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:448)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:142)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:59)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.call(CallTestCaseKeyword.groovy)
at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:74)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.callTestCase(CallTestCaseKeyword.groovy:81)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.execute(CallTestCaseKeyword.groovy:44)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
at com.kms.katalon.core.keyword.BuiltinKeywords.callTestCase(BuiltinKeywords.groovy:350)
at ValidLogin.run(ValidLogin:30)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:448)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:142)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:133)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1678647893939.run(TempTestCase1678647893939.groovy:25)
)
at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:39)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.builtin.VerifyElementNotVisibleKeyword$_verifyElementNotVisible_closure1.doCall(VerifyElementNotVisibleKeyword.groovy:83)
at com.kms.katalon.core.webui.keyword.builtin.VerifyElementNotVisibleKeyword$_verifyElementNotVisible_closure1.call(VerifyElementNotVisibleKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
at com.kms.katalon.core.webui.keyword.builtin.VerifyElementNotVisibleKeyword.verifyElementNotVisible(VerifyElementNotVisibleKeyword.groovy:97)
at com.kms.katalon.core.webui.keyword.builtin.VerifyElementNotVisibleKeyword.execute(VerifyElementNotVisibleKeyword.groovy:67)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyElementNotVisible(WebUiBuiltInKeywords.groovy:391)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$verifyElementNotVisible$7.call(Unknown Source)
at Verify fields are Mandatory.run(Verify fields are Mandatory:54)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:448)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:142)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:59)
… 18 more
Caused by: com.kms.katalon.core.exception.StepFailedException: Object ‘Object Repository/Login Page/errorMessages’ is visible
… 37 more
)

Then, what do you want?

Hi @kazurayam,

I’m searching for a solution that prevents the error from appearing in the log viewer as a failed step. This doesn’t make sense since the test was called and executed successfully, so only actual failed steps should be displayed. I attempted to use try/catch and exception handling, but it was unsuccessful.

Hello. did you find out solution ?

I don’t understand this because I found a StepFailedException in the log:

To me, this messages is saying that the test was called and failed.

@aneeqnawaz04

You used WebUI.verifyElementNotVisible() keyword as the message shows:

Caused by: com.kms.katalon.core.exception.StepFailedException: Object ‘Object Repository/Login Page/errorMessages’ is visible (Root cause: com.kms.katalon.core.exception.StepFailedException: Object ‘Object Repository/Login Page/errorMessages’ is visible
...
at com.kms.katalon.core.webui.keyword.builtin.VerifyElementNotVisibleKeyword$_verifyElementNotVisible_closure1.doCall(VerifyElementNotVisibleKeyword.groovy:83)

Are you sure you really want to verify the target HTML element Not to be present in the page?

I ask this because people rarely does such test. I have never seen a post in this forum where people use verifyElementNotPresent.

Sure, here’s a rephrased version:
Please refer to the attached screenshot of the log viewer.

  • The first failed statement indicates that an element is visible when it should not be, according to the condition set by the WebUI.verifyElementNotVisible() keyword.
  • The second failed statement states that the test case failed due to the issue mentioned above.
  • However, the third point does not provide an accurate message since there is nothing wrong with the test case calling.

What message do you like to see in this case?
Or you do not like to see any message at all?

So, the reason for using WebUI.verifyElementNotVisible() I’m verifying a case if the user clicks on the login button, an error should displayed that the fields are mandatory. However, the error should not be displayed once the field gets filled. So, WebUI.verifyElementNotVisible() is being used to ensure that the error message is not visible once the fields are filled, indicating that the fields are no longer empty and the login button can be clicked without any errors.

I believe the third message is causing confusion and should be removed as it suggests there is an issue with the testcase calling.

I agree that the third message is confusing. Especially the message emitted by the negating keywords (`verify X xxxx Not YYYY’) would be puzzling. I would call it a philosophical message.

However, you can not tailor the error message from the verifyElementNotVisibile keyword.

Any solution?

Yes.

Use WebUI.waitForElementNotPresent(TestObject). this will NOT throw StepFailedException. It will print a single line of warning (same as ‘… is visible’), which you should not mind much.

The keyword will return a Boolean result. Then you can control the flow of your script based on the returned result:

if (the result of wait...) then {
....
}

You can use KeywordUtil to implement a post-processing.

If you want print a preferable message, use logInfo() method.
If you want show a readable warning, use markWarning().
You can use other methods like markFailed, markFailedAndStop, etc if you like.

I understand your point, but I used other assertion like WebUI.verifyElementVisible() or WebUI.verifyEqual() in every test case? What if any of them gets failed? Do I have to add IF check for each assertion and KeywordUtil for display desire output.

I don’t know. It is up to you. Would depends on cases.

All I would tell you is

  • WebUI.verifyXXXX() will throw StepFailedException when the condition has been found false even if the falsive result was known to occur. You can not tailor the message in the Exception thrown.
  • WebUI.waitForXXX() will NOT throw StepFailedException even if the condition has been found false. It will return a Boolean result. So you will have an option how to process the falsive case.

I would rather like to suggest to you not to be too much strict about the message text.
If you have a failure, the mesage text would not matter much. You would just want to fix it.

You would want to replace WebUI.verifyXXX() to WebUI.waitForXXX() only in the case where an insident occured, which is NOT a failure for you but Katalon ignorantly reported it as a failure to be fixed.

Hello
Issue solved or still your facing ?

Hi @Noor_Ahmed_Khan
Nope, I have to look for other approach

join me on skype , so I can try to sort out your issue
live: noor.ahmed_13
zoom : noor.ahmed@skylines.ae

Sure I will ping you.

Thank … you