Ask a Question

nested if-statemenet

SOLVED
RobvanBeest2
New Contributor

nested if-statemenet

Hello,

 

I want to use nested if statements whlie using keyword testing.

When I do so, I get an error.

Only 1 if..then..else statement seems to work.

Can anybody tell me the exact syntax of nested i-statements?

RobvanBeest2_0-1653309944824.png

 

5 REPLIES 5
ebarbera
Staff

Hello @RobvanBeest2 - 

 

What is the error message you receive?

 

Emma

 

Hello Emma,

 

I got the messages: "Exception" and "The test execution was interrupted"

 

Rob

Your second else is not lined up with the If statement.  They need to match like your first two do.

Marsha_R_0-1653328122909.png

 


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame

Hi Marsha,

 

Thanks for the solution!

This works.

I've just started with TestComplete and adding some logical statements tot my keyword testing.

So I am not familiar yet with the exact syntax.

 

Rob

You're welcome! Don't worry about it, even those of us who have been doing this for awhile will get typos in there occasionally. It's always easier for someone else to see it.  😉


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
cancel
Showing results for 
Search instead for 
Did you mean: