New to Telerik Test Studio? Download free 30-day trial

If... Else Logical Step Fails

Problem

I added an If...Else logical step to my test. When the verification attached to the IF portion is true, that branch correctly executes. However, when that verification is false, the ELSE branch does not execute and the test fails.

Solution 1

The issue is likely with the verification attached to the IF portion. Let's say it verifies the element is visible. When the element does not exist and cannot be found, the verification cannot be performed, the ELSE portion is not executed, and the entire test fails.

The fix is to record a new verification on the element and attach it to the IF. This time, record a Wait - element exists step. This way, when the element does not exist, the ELSE portion will correctly execute and the test will not fail.

Test Steps

Solution 2

If the if..else conditional steps continue executing incorrectly, see here other possible solution to address the misbehavior.

See Also

In this article