Data verification issue in keywords

I have a Modal dialogue that I open at different times from different test cases. Each time I like to verify
same data on the dialog before moving to next step in the test case. Because the verification of the data is same in all test cases I decided the move the verification to keyword.

Problem is when I do verification from the test case, console output will show that verification was done but if I move the verification to Keyword, nothing is displayed under Console Output, it only shows the keyword call that we make from the test case.

If Verification is inside the test case, console out shows the following:

2024-04-12 09:53:49.265 DEBUG testcase.2_Merge - 10: verifyElementText(findTestObject(“ABC/Modals/Merge/h3_merge_header”), “Hello World”)
2024-04-12 09:53:49.265 DEBUG testcase.2_Merge - 13: verifyElementChecked(findTestObject(“ABC/Modals/input_checkbox_Name”), 60)
2024-04-12 09:53:50.300 DEBUG testcase.2_Merge - 14: verifyElementNotChecked(findTestObject(“ABC/Modals/input_checkbox_Age”), 60)
2024-04-12 09:53:51.761 DEBUG testcase.2_Merge - 15: verifyElementNotChecked(findTestObject(“ABC/Modals/input_checkbox_Place”), 60)

If the same code of verification is inside the keyword then the console out shows the following:

2024-04-12 09:53:49.265 DEBUG testcase.2_Merge - 9: com.Pages.ABC.VerifyDataonMergeModal()

2024-04-12 10:31:13.600 INFO k.k.c.m.CustomKeywordDelegatingMetaClass - com.Pages.ABC.VerifyDataonMergeModal is PASSED

Thanks in advance!

1 Like

Did you read this?

We need to see the code you’re working with. Make sure you highlight the code that is NOT working. And show us your custom keywords and how you are including them in your Test case.

Hi there,

Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.

In the meantime, please also check out our posting guide below to see if you may need to add any extra info in your topic to help us help you better :point_down:

Thanks! :sunglasses:

If all you are looking for is a log of your verification, then change your Keyword to a “callTestCase” instead. A called Test Case leaves a log, whereas a Keyword does not.

Depends how it is used.

A post was split to a new topic: Why am I seeing automated response from “system”?

Thank you for the response. If I do the verification within the test case or inside another testcase and then “callTestCase”, I do see the logs.

Here’s my keyword:

public VerifyDataonMergeModal()

	WebUI.verifyElementChecked(findTestObject('ABC/Modals/input_checkbox_Name'), 60)
	WebUI.verifyElementNotChecked(findTestObject('ABC/Modals/input_checkbox_Age'), 60)
	WebUI.verifyElementNotChecked(findTestObject('ABC/Modals/input_checkbox_Place'), 60)