How to add If else command in recorder


#1

I’m not able to add if else command. What is the correct way to add that in the script.


#2

Hello Deepika,
welcome in the Katalon community.
You can use the if command very easily, here an example:

Best regards
Stefan

KatalonAutomationRecorder_IfExample.JPG


#3

Hello
I want to test
**if i not equal to 1 **
i don’t find how to test
can you help me ?


#4

if ${i} != 1


#5

ok thanks :slight_smile:


#6

hi i need find string to verify (If statement)


#7

“No more candidates awaiting Authorization” this is shown in body text then continue the expression otherwise wait

Help me


#8

You want to test this string ?
You can store this in a variable eg . lv_Text
If lv_Text==“No more candidates awaiting Authorization”


#9

In Katalon recorder it doesn’t recognize if statement even though its in the list. I’m trying verify if text is on the webpage but not having any success. I’m using an xpath for the target as we cannot create unique IDs in Salesforce. Any ideas?


#10

why some commands are executed even the condition is not true?..

in my example close is inside if and even with condition is false is being executed?


#11

Hi
pamcsmash, do you run entire test case or double clicking commands?? You need to run full testcase or at least use “Play From Here”. It’s the last option in context menu when you right click on some command. Double clicking the command can work only for simple command like click or something.

brian123abcd, Katalon just work that way. It’s mark it green because there was no error in this command and it goes throught it properly not neceserliy execute it. For what I know the only command that really execute inside if even when the condition is false is pause command.