Failed tests are part of the testing process, but when they’re for a known anomaly it’s beyond frustrating. Creating unique test flows every possible iteration is exhausting and frankly not always necessary.
Which is why I’m excited to share you no longer need to worry about testing fails for this reason with Sofy. Conditional testing is now possible with Sofy! You’ll see reduced testing fails, increased flexibility, and overall, more resilient and smoother tests.
How Does this Feature Solve the Challenge?
Conditionals allow developers to control what the program show do and perform different actions based on “if, then” logic statements. Without conditionals, testing can become a nightmare: Multiple test runs and not knowing how the test will perform.
To solve these challenges, we’re excited to announce Conditionals – a powerful feature to help you stay focused on coding, faster feedback loops and shipping high quality mobile apps.
Smarter Tests Without Delays
As part of the Conditional feature, you can now “skip” certain steps on your test. The “skips” are based on if a certain condition or assert holds a true/false. You can also instruct Sofy to behave exactly as you intend, in case of an unexpected behavior.
For example:
Depending on the OS version, your App surfaces a permissions dialog box, asking the user to select “Allow” or “Don’t Allow” as an option before moving to the next step. With the Conditions feature enabled, you can either let the test case continue if the dialog box appears or move on to the next step if the dialog box doesn’t appear. With this feature you can now take into account the App behavior depending on the OS version and ensure that the test case is executed as intended.
In this recording you’ll learn:
- How to add “If” and “Else” statement workflows to your Test Cases
- How to identify any differences between your authored test and the current execution
- How to view all element properties in the Tab Element Explorer
How Conditionals Work
1. Click on the Automation tab from the left panel on your Home Screen.
2. Click on the Edit icon (pen) next to the test case which you wish to insert a Conditional. For example, you can insert a Conditional inside “test3” here.
3. Inside the Edit Test section, select the step where you wish to insert a conditional. As an example, we selected Step 2.
4. In the action bar of the step which pops up, select the icon with the curly braces which denotes Conditionals.
5. In the Add Condition dialog box, select the element you wish to insert a conditional. In our case, we selected the element “Allow”.
6. After making the selection, choose your desired option from the “Verify That” dropdown. In our case, we selected “Verify that: Test component is present”.
7. After that, you can choose to either skip this step or execute this step in the same fashion as you recorded originally. In our case, we decided:
– “Verify that: Test Component is present”
– “Then: Execute Step as Recorded”
– “Else: Skip this step”
8. A yellow curly braces icon signifies that a conditional has been added to that step.
9. When executing a test with conditionals, a yellow curly braces icon denotes that a conditional was applied to that step. For example, on step 2, there was a conditional applied where the original action was a click.
10. Additionally, when you check Test Results located in the Runs & Report section, you will see the conditional step marked with a yellow tag. Moreover, in the details section of that step, you will find the conditions applied.
11. If you skip a certain step, it will appear with the label “Step(s) Skipped”. To view the step skipped, you can click on Show Me.
Other Product Enhancements
The Compare to Recording page in Sofy has undergone improvements for increased ease of use. The updated design allows you to quickly identify any differences between your authored test and the current execution. Additionally, a new Element Explorer provides a convenient way to view all element properties. These updates enhance the overall experience and simplifies the process of troubleshooting your test executions.
To learn more about our product release notes, go here.
Get Started
If you’re a current Sofy customer you can start saving time and steps by simply adding a conditional to your test runs. Login today. Don’t have a Sofy account? Get a demo and explore Conditionals and our newest product enhancements.