This method is available in legacy mobile tests that work with devices connected to the local computer. To learn how to simulate user actions in newer cloud-compatible mobile tests, see the Simulating user actions in tests section. |
Description
This method captures the image of the specified rectangular area of the mobile object and returns the Picture
object that provides a scripting interface to the captured image.
Declaration
TestObj.Picture(ClientX, ClientY, Width, Height, Mouse)
TestObj | A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section | |||
ClientX | [in] | Optional | Integer | Default value: 0 |
ClientY | [in] | Optional | Integer | Default value: 0 |
Width | [in] | Optional | Integer | Default value: -1 |
Height | [in] | Optional | Integer | Default value: -1 |
Mouse | [in] | Optional | Boolean | Default value: True |
Result | A Picture object |
Applies To
All Android, iOS and Xamarin.Forms objects
View Mode
To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.
Parameters
The method has the following parameters:
ClientX
Specifies the left coordinate of the top-left corner of the rectangular area (0 by default). This coordinate is specified relative to the underlying control.
ClientY
Specifies the top coordinate of the top-left corner of the rectangular area (0 by default). This coordinate is specified relative to the underlying control.
Width
Specifies the width of the rectangular area. The value of -1 (default) indicates that the rectangular area spreads to the right edge of the object.
Height
Specifies the height of the rectangular area. The value of -1 (default) indicates that the rectangular area spreads to the bottom of the object.
Mouse
This parameter is ignored.
Result Value
The Picture
object that represents the captured image.
Remarks
To capture the image of the entire visible area of a mobile object, call Picture
without any parameters.
Note that the method captures only the visible part of the onscreen object. Regions beyond the visible part are not captured. To get the image of such regions, you need to make them visible first (for example, scroll to the desired position) and then call the Picture
method.
See Also
Testing Android Applications (Legacy)
Testing iOS Applications (Legacy)
Picture Object