Adding a Swipe Until Action to a Test Case - Sofy Support Docs: No-Code Automation Testing Platform Help

Adding a Swipe Until Action to a Test Case

When testing an app, the number of swipes needed to find an element can vary by device and screen size—often causing tests to fail.

The Swipe Until condition solves this by letting you specify that the system should swipe up or down until the target element is found.

You set a maximum number of swipes to avoid endless scrolling.

The test will pass if the element is found, or fail if the swipe limit is reached.

This makes your tests more reliable across different devices without extra manual adjustments.

If you’re using the "Swipe Until" feature within a WebView and notice that it’s not functioning as expected, we suggest using standard swipe actions for these scenarios.

Adding a Swipe Until Action to a Test Case Step

  1. Log in to your Sofy account.
  2. Select Automation from the left navigation bar.
  3. Search for and select a test containing Swipe actions.
  4. If you have multiple steps that contain a Swipe action, click on the first step and select Edit from the toolbar that pops up.
  5. Navigate to the Swipe Until tab.
  6. Toggle on the Swipe Until setting to enable it.
  7. Under Which element(s) do you want to detect?, check the box next to each of the following settings to configure them:
  1. Select Save Step Changes. The Swipe step will change to a Swipe Until step.
  2. If you have multiple Swipe steps, disable or delete the remaining Swipe steps in the test case.
  3. Once you’re done making changes to the test case, select Save Test in the top right-hand corner.

Example: Swipe Until Country Name is Found

Let’s say you’re testing the signup function of your app, and you have a step that requires the user to scroll through and select a country from a list. On one device, it may take five swipes to select the desired country, while on another device with a larger screen it may take only three swipes.

Instead of creating a separate test case for each device and screen size, you can enable the Swipe Until action to the first Swipe step and configure the following settings:

Don’t forget to disable the remaining Swipe steps in the test case!

Adding Swipe Until to your Test in Sofy Lab

You no longer need to navigate to Offline Edit Mode for a test case to use Swipe Until - You can add Swipe Until while recording and validating now!

  1. During Recording, you can add Swipe Until by first clicking on Add Steps as highlighted below at the bottom of the screenshot:

  2. You could also add a Swipe Until enhancement during validation.

  3. Click on the Edit Step for the Swipe action

  4. Click on the Edit icon highlighted in red

  5. You will then be able to enable Swipe Until and use it as needed.