Robotframework syntax - is nested Run Keyword If with ELSE supported?

1,599 views
Skip to first unread message

adam.wyp...@gmail.com

unread,
Jun 15, 2018, 2:04:26 AM6/15/18
to robotframe...@googlegroups.com
Hello,

I've been tried to find an information if syntax like: 

Run Keyword If (condition_1) 
             Run Keyword If (condition_2) (new_keyword_1) ELSE (else_keyword_1)
ELSE
             (else_keyword_2)

is supported. So far I only I've found only an information on stackoverflow https://stackoverflow.com/questions/34590001/robot-framework-nested-if-statement  saying "strickly speaking, no".

The reason, why I am asking is because ELSE for (condition_2) is used for both (condition_1) and (condition_2) without any error message saying syntax is not supported.

Thanks in advance & Best Regards,
-Adam.






Deepak Singh

unread,
Jun 15, 2018, 3:02:34 AM6/15/18
to adam.wyp...@gmail.com, robotframework-users
No ,you cant use nested If or nester for loop.
however if you want certain condition to execute inside if condition you can create saperate keyword for the condition and call it in if loop.


On 15-Jun-2018 11:34, <adam.wyp...@gmail.com> wrote:
Hello,

I've been tried to find an information if syntax like: 

Run Keyword If (condition_1) 
             Run Keyword If (condition_2) (new_keyword_1) ELSE (else_keyword_1)
ELSE
             (else_keyword_2)

is supported. So far I only I've found any information on stackoverflow https://stackoverflow.com/questions/34590001/robot-framework-nested-if-statement  saying "strickly speaking, no".

The reason, why I am asking is because ELSE for (condition_2) is used for both (condition_1) and (condition_2) without any error message saying syntax is not supported.

Thanks in advance & Best Regards,
-Adam.






--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

adam.wyp...@gmail.com

unread,
Jun 15, 2018, 3:07:00 AM6/15/18
to robotframework-users
As I said my main reason to ask is because the RF doesn't inform that syntax is incorrect and perform action base on the first ELSE . - The reason, why I am asking is because ELSE for (condition_2) is used for both (condition_1) and (condition_2) without any error message saying syntax is not supported.



W dniu piątek, 15 czerwca 2018 08:02:34 UTC+1 użytkownik Deepak Singh napisał:
No ,you cant use nested If or nester for loop.
however if you want certain condition to execute inside if condition you can create saperate keyword for the condition and call it in if loop.

On 15-Jun-2018 11:34, <adam.wyp...@gmail.com> wrote:
Hello,

I've been tried to find an information if syntax like: 

Run Keyword If (condition_1) 
             Run Keyword If (condition_2) (new_keyword_1) ELSE (else_keyword_1)
ELSE
             (else_keyword_2)

is supported. So far I only I've found any information on stackoverflow https://stackoverflow.com/questions/34590001/robot-framework-nested-if-statement  saying "strickly speaking, no".

The reason, why I am asking is because ELSE for (condition_2) is used for both (condition_1) and (condition_2) without any error message saying syntax is not supported.

Thanks in advance & Best Regards,
-Adam.






--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.

adam.wyp...@gmail.com

unread,
Jun 15, 2018, 3:19:30 AM6/15/18
to robotframework-users
Ok, I created GitHub issue for this issue https://github.com/robotframework/robotframework/issues/2871 .
Reply all
Reply to author
Forward
0 new messages