diff --git a/lib/helper/WebDriver.js b/lib/helper/WebDriver.js index 573bad4a3..93addf623 100644 --- a/lib/helper/WebDriver.js +++ b/lib/helper/WebDriver.js @@ -1245,7 +1245,7 @@ class WebDriver extends Helper { const elem = usingFirstElement(res); const elementId = getElementId(elem); if (this.browser.isMobile) return this.browser.touchScroll(elementId, offsetX, offsetY); - const location = await this.browser.getElementLocation(elementId); + const location = await elem.getLocation(); assertElementExists(location, 'Failed to receive', 'location'); /* eslint-disable prefer-arrow-callback */ return this.browser.execute(function (x, y) { return window.scrollTo(x, y); }, location.x + offsetX, location.y + offsetY);