MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / grabElementBoundingRect

Method grabElementBoundingRect

lib/helper/WebDriver.js:2915–2926  ·  view source on GitHub ↗

* {{> grabElementBoundingRect }}

(locator, prop)

Source from the content-addressed store, hash-verified

2913 * {{> grabElementBoundingRect }}
2914 */
2915 async grabElementBoundingRect(locator, prop) {
2916 const res = await this._locate(locator, true)
2917 assertElementExists(res, locator)
2918 const el = usingFirstElement(res)
2919
2920 const rect = {
2921 ...(await el.getLocation()),
2922 ...(await el.getSize()),
2923 }
2924 if (prop) return rect[prop]
2925 return rect
2926 }
2927
2928 /**
2929 * Placeholder for ~ locator only test case write once run on both Appium and WebDriver.

Callers 1

dragSliderMethod · 0.95

Calls 3

_locateMethod · 0.95
usingFirstElementFunction · 0.85
assertElementExistsFunction · 0.70

Tested by

no test coverage detected