Adding a Visual Match to a Test Step
Visual Match allows you to override and fine-tune your click target in automated test steps. When enabled, you can draw a new bounding box around the element you’d like Sofy to select during test playback.
Visual Match is best used in the following cases:
- When the XML path for the element is difficult to detect, such as
- when an element is hidden under a popup or
- when the elements on the screen are not uniquely defined based on best practices.
- For WebView components and visual components such as barcodes
1. Running the same automated test on devices that have largely different screen sizes. For example, the test was recorded on a mobile device and played on a tablet.
2. The custom bounds are drawn around an area that might contain noise. For example, if your app has a white background and the element you’ve selected has a lot of white space, the system might mark those white spaces as redundant, resulting in a false positive or incorrect match.
3. When there might be multiple elements on the screen which are visually identical, like many checkboxes on one screen or other similar-looking items such as similar-looking flags of countries
4. Element-matching which relies heavily on color, like a comparing two identical logos having slightly different color combinations
Adding a Visual Match to a Test Step
- Log in to your Sofy account.
- Go to Automation from the left navigation bar.
- Select a test case.
- Find and select the step you want to add a Visual Match override to, then select Edit from the popup.
- Select the Visual Match tab.
- Click the toggle to enable Visual Match.
- Check the Create Custom Bound box.
- In the image to the left, click and drag your mouse over the desired area to create a green custom-bound box. The box coordinates will appear in the Custom Bounds field.Note: Ensure that you’re as precise as possible when drawing the custom-bound box.
- If you need to redo the custom bound box:
- Click and drag your mouse again to remove the original box and create a new one.
OR - Click Remove next to the Custom Bounds field, then draw your box again in the image.
- Click and drag your mouse again to remove the original box and create a new one.
- Once you’re done, click Save Step Changes.
- Select Save Test in the top right-hand corner to finish saving your changes.
Note: You can’t use both a Manual Override and a Visual Match override in the same step.