CaptureElement
Description
Use this command to capture a screenshot of a part of the device’s screen in a given time and create a new element in the zone runtime that you can use in later steps of your scripts. This can be highly useful when the elements on the screen change often or for image comparisons. Once the image is captured, it can be then clicked using click
.
Parameters
Name | Value | Description |
---|---|---|
name | String | Name that will be given to the captured Element |
X | Integer | First point X |
Y | Integer | First point Y |
Width | Integer | Width of the captured area |
Height | Integer | Height of the captured area |
Similarity | Integer | Integer number between 80-100. Enables to define the tolerance of changes when searching for the image. |
Usage
info
Replace <server> with the appropriate URL.
- Public Continuous Testing Cloud - https://cloud.seetest.io/wd/hub/.
- Dedicated Continuous Testing Cloud environment - Your own domain. For example: https://company.experitest.com/wd/hub/
- On-premises Continuous Testing Cloud environment - Your designated URL. For example: https://company.com/wd/hub
Example
In the following example we capture the Calendar Element.
**
**
CaptureElement
DesiredCapabilities dc = new DesiredCapabilities();
driver = new AndroidDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);
dc.setCapability(MobileCapabilityType.UDID, "deviceid");
...
...
//Get the current foreground activity
seetest.captureElement("Calendar", 275, 255, 264, 299, 100)
seetest.click("runtime", "Calendar", 0, 1)