cancel
Showing results for 
Search instead for 
Did you mean: 

Nested if then's

SOLVED
Highlighted
Occasional Contributor

Nested if then's

Hi All,

  New to TC so I'll apoligize in advance if this has been asked/answer.  I searched but found little.  Does TC support nested if then else statements?  ie Can I put another If..Then under the Else?  

  I ask b/c as individual If..Then statements I see the behavior I would expect.  As soon as I try nesting these all I ever get is the behavior in the last Else statement.  I 'believe' I have my indentations correct.  It behaves properly when not nested.  

  The scenario I'm attempting is the app will have 1 of 3 random security questions pop up on attempting to login.  Based on that security question, obviously I enter specific text.  

  Thanks in advance.  
NestedIfs.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: Nested if then's

Yes, you can.   You can nest as many if thens as you want to.  It's just a matter of dragging/dropping the desired If/Then under the parent.

 

nestedifthen.png


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

2 REPLIES 2
Highlighted
Community Hero

Re: Nested if then's

Yes, you can.   You can nest as many if thens as you want to.  It's just a matter of dragging/dropping the desired If/Then under the parent.

 

nestedifthen.png


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

Highlighted
Occasional Contributor

Re: Nested if then's

Thank you Tristan, I"ve read quite a few of your posts.

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Compare images using the Region Checkpoint

See replies!

Converting UTC TimeDate in an Excel file

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors