"ELSE_IF" Command

Description: This command executes executes a step when the preceding If condition is not met. Otherwise, it skips the condition and moves to the next step.

Usage Scenario: Suppose we need to compare the number of profiles on our Reference app and print a message if it is less or equal to 100, or print another message if it is greater than 100 .

Procedure: Define a step with Get_Web_Value command (with either one of the XPaths below) that counts the profiles and an If command for the initial check of less than or equal to 100. Define an Else_IF command for the greater than 100 step. Your steps will look like this:

count(//th[@scope='row' and @class='ng-binding'])

count(//a[contains(@href,'profile') and @class='ng-binding'])

image-20240606-142249.png
image-20240606-142210.png

 

See the Test Library path: subject7_samples/subject7_intermediate_suite/subject7_count_profiles



Â