Page tree
Skip to end of metadata
Go to start of metadata

Description


The command enables you to capture a screenshot of a part of the device’s screen in a given time and create a new element in zone "runtime" that you can use in later steps of your scripts.

Parameters

NameValueDescription
nameStringName that will be given to the captured Element
XIntegerFirst point X
YIntegerFirst point Y
WidthIntegerWidth of the captured area
HeightIntegerHeight of the captured area
SimilarityIntegerInteger number between 80-100. Enables to define the tolerance of changes when searching for the image.

Usage

Designed command for image recognition during runtime.

This can be highly useful when the elements on the screen changes very often or for image comparisons. Once the image is captured, it can be then clicked using click command.

Set Experitest Url

Please make sure you replace <EXPERITEST_URL> with appropriate URL in the code snippet below.

Example

In the following example we capture the Calendar Element.


CaptureElement
DesiredCapabilities dc = new DesiredCapabilities();
driver = new AndroidDriver(new URL("<EXPERITEST_URL>"), 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)



  • No labels