Setting Up the Clip for Partial Image Validation
Partial image validation is available for validation of selected portions of a view in both iOS and Android native apps.
- Open the test clip in which partial image validation will be performed.
- If screenshot validation is enabled at the target level, turn it off by unchecking Add verify screenshot during recording. If a change was made, click Save.
- With the device's TouchTest Agent active, click Record in the Clip Editor toolbar. When you do so, the Choose a Device Agent and Mobile App box appears with the clip's device agent/mobile app combination pre-selected.
- Click the Record button in the Choose a Device Agent and Mobile App box.
- If a change was made, click Save.
- Select the app action to add a verifyScreenshot validation and click the Gear icon to invoke the Info Window (this can also be done in the lower panel Action Editor).
- Select the Validation tab and click the green Plus icon to add a validation form.
- Click the Command drop-down to add verifyScreenshot.
- Click into the verifyScreenshot's Locator field and invoke the Touch Locator.
- Click the Touch Locator icon in the Locator row to enter Locator mode. The blue Locator border appears in the app on the device.
- Select the view in the app until the Locator detail appears. For example, as shown below in the Stockfish, Chessboard view.
Selecting the Partial View
Next, we will perform the steps to select a custom, or partial, view. This custom view should be a region smaller than the width/height of the screen.
- Ensure that the mobile app is in the state you want to capture. For example, in the capture below no pieces have been moved and nothing has been selected (i.e. we are just cropping a portion of the Chessboard view before any moves are made).
- Do a long press until the blue border adjusts and the Locator box appears with a Custom view locator box.
- Use drag and pan actions to arrange all four corners (each of which is indicated by a blue dot) until the Custom frame is in the desired position.
- When ready, click the Up arrow in the Custom title bar to add the locator to the clip on your desktop client and exit Touch Locator mode. This will also exit Record mode in the Clip Editor.
- The screenshot will be populated into the Screenshot field in the Validation form.
- Save the test clip before exiting the Clip Editor.
When the test clip is played in a test composition, the validation will appear in Result Details with the result for the given app action. Maximize the Outputs section to get a better view.
If the partial image validation didn't pass, the verifyScreenshot (in the Result Details dashboard, Waits and Validations section will indicate so.
In the Output section the Diff tab is presented with a brown border around the offending portion of the screenshot.