If(false) - pause still executes, logs print 'executing' when it doesn't for lines it skipped

If you have a pause in an if block that failed, the pause will still execute, adding unnecessary time to the test case.

Script:

storeEval | new Date() | startTime
if | 1 === 2 | 
pause |  | 10000
storeEval | new Date() | doesntExecute
else |  | 
storeEval | new Date() | endTime
endif |  | 

Output:

[info] Playing test case Test / Untitled Test Case
[info] Time: Mon Nov 25 2019 10:37:20 GMT-0500 (Eastern Standard Time) Timestamp: 1574696240886
[info] OS: Windows Version: 10
[info] Browser: Firefox Version: 70.0
[info] If the test cannot start, please refresh the active browser tab
[info] Executing: | storeEval | new Date() | startTime |
[info] Store 'Mon Nov 25 2019 10:37:20 GMT-0500 (Eastern Standard Time)' into 'startTime'
[info] Executing: | if | 1 === 2 | |
[info] Executing: | pause | | 10000 |
[info] Expand variable '' into ''
[info] Executing: | storeEval | new Date() | doesntExecute |
[info] Executing: | else | | |
[info] Executing: | storeEval | new Date() | endTime |
[info] Store 'Mon Nov 25 2019 10:37:31 GMT-0500 (Eastern Standard Time)' into 'endTime'
[info] Executing: | endIf | | |
[info] Time: Mon Nov 25 2019 10:37:31 GMT-0500 (Eastern Standard Time) Timestamp: 1574696251034
[info] Test case passed

As you can see the endTime has 10 unnecessary seconds added on. It would also be useful if it indicated it skipped a line Executing: | storeEval | new Date() | doesntExecute | instead of “Executing” when it doesn’t execute because the if block failed.

1 Like

Yep, it’s a bit confusing sometimes. Especially when I have a lot of if and gotoLabel. What is interesting if You run this second time it goes as it should but with over 100 testcase in one go…