.getSize()
Retrieves width and height of element.
Usage
element(matcher).getSize()
Returns
Promise
(Object
):
width
(Number
): Width of element.height
(Number
): Height of element.
Support
Platform | Supported |
---|---|
iOS | Yes |
Android | Yes |
Web | Yes |
Examples
Get width and height of button:
const { element, by, expect } = require("appdriver");
(async () => {
const size = await element(by.label("button"))
.getSize();
return expect(size).toEqual({
width: 250,
height: 48
});
})();