Region method

Class: RegionPlatform: WebdriverIO 5Language: JavaScript SDK:

A constructor to an object describes a rectangular region at a particualar coordinate.

Syntax


let obj = new Region(region);

let obj = new Region(object);

let obj = new Region(location, size);

let obj = new Region(left, top, width, height);

Parameters

region
Type:<a class ='link' href='/Content/api/eyes-sdk/index-gen/class-region-webdriverio_sdk5-javascript.htm'>Region</a>
The region provided as a parameter specifies both the top left of the new region and its dimensions.
object
Type:{left:number,top:number,width:number,height:number}
Instead of an object of the Region class, you can provide any object that meets the following definition:
 {left: number, top: number, width: number, height: number} 
.
location
Type:<a class ='link' href='/Content/api/eyes-sdk/index-gen/class-location-webdriverio_sdk5-javascript.htm'>Location</a>
The object passed as a parameter specifies the top left of the new region. Instead of an object of the Location class, you can provide any object that meets the following definition:
 {x: number, y: number} 
.
size
Type:<a class ='link' href='/Content/api/eyes-sdk/index-gen/class-rectanglesize-webdriverio_sdk5-javascript.htm'>RectangleSize</a>
The object provided as a parameter specifies dimensions of the region. Instead of an object of the Location class you can provide any object that meets the following definition:
 {width: number, height: number} 
.
left
Type:number
The X coordinate of the left edge of the region in pixels.
top
Type:number
The Y coordinate of the top edge of the region in pixels.
width
Type:number
The width of the region in pixels.
height
Type:number
The height of the region in pixels.

Return value

Type: <a class ='link' href='/Content/api/eyes-sdk/index-gen/class-region-webdriverio_sdk5-javascript.htm'>Region</a>