How to Intercept the outcome of Verify commands in the Katalon Recorder


#1

Hi,
I am trying to create a test case that uses a VerifyElementPresent and, depending on the outcome
of the command, It should be able to enter in an IF / ELSE condition

For instance,
f ${!LastCommandOK}
click| link=Link1
else
click| link=Link2

I have read that Katalon doesn’t support !LastCommandOK and, therefore, I am wondering how I can
detect the outcome of a test step with a Verify command. For instance if it passed or failed (True /False)
Once I get this information I suppose I could use it in a IF / ELSE condition. Unless there is another
way to do this thing.

Thanks for your support.


#2

I will add LastCommandOK soon. Sorry for letting you and other people wait for so long.


#3

Can you suggest me any workaround to do the same thing in the meantime that you add the “LastCommandOK” ?

Thanks for your support.


#4

You can use following instructor to verify the element in the condition https://docs.katalon.com/katalon-studio/tutorials/how_to_check_element_status_in_conditional_statement.html


#5

Brian thanks very much for your reply. The tutorial you recomended is really helpful but I would like to use only the Katalon Recorder tool without having to write code. Is it possible?

Thanks for your support.


#6

Try using storeElementPresent | locator | variable, then variable will be true or false depends on the outcome.


#7

Hi, thanks for your reply. I have tried the “storeElementPresent” and it works fine. I am wondering if there is a particular “Store”- type like command (like the “storeElementPresent” one) that checks if a checkbox is set to true and lets me store the value “True” (or “False”) into a variable.

Thanks for your support.


#8

You could use storeValue to get the checkbox value
Command: storeValue
Target: id=MyCheckBox
Value: MyCheckBoxValue

Note that if the checkbox is checked then the value is ‘on’,
and if it is unchecked then the value is ‘off’.

You can see the values in the Log by using:
Command: echo
Target: ${MyCheckBoxValue}


#9

Will lastcommandok in katalon work the same as in kantu?