Skip to main content

P2CX

Description

According to the given percentage, this command will return the active device's width pixel count (X Coordinate) as an Integer. 

With this command and the matching P2CY command, you can avoid relying on coordinates and to give relative size not based on resolution of device.

Parameters

NameValueDescription
PercentageIntegerGiven screen percentage Value will be between 0 to 100

Usage

Example

In the following example we will get the width pixels value of 80% of the screen (where the EriBank logo ends (X coordinates of 80% of the screen)

info

Replace <server> with the appropriate URL.

P2CX

DesiredCapabilities dc = new DesiredCapabilities();
driver = new AndroidDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);
dc.setCapability(MobileCapabilityType.UDID, "deviceid");

...
...
seetest.p2cx(80);