Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getElementRect = async (selector: string) => {
const rect: DOMRect | null = await this.browser.execute(
getBoundingRect,
selector
) as DOMRect | null;
if (!rect) {
throw new ElementNotFound(selector);
}
return {
x: rect.x,
y: rect.y,
width: rect.width,
height: rect.height
};
};