diff --git a/lib/Page.js b/lib/Page.js index 264ddb156d8..43566eac5af 100644 --- a/lib/Page.js +++ b/lib/Page.js @@ -512,8 +512,8 @@ class Page extends EventEmitter { try { const nodeId = await this._querySelector(selector); let boxModel = (await this._client.send('DOM.getBoxModel', { nodeId })).model.content; - let x = Math.round((boxModel[0] + boxModel[4]) / 2); - let y = Math.round((boxModel[1] + boxModel[5]) / 2); + let x = Math.round((boxModel[0] + boxModel[4]) / (2 * this._screenDPI)); + let y = Math.round((boxModel[1] + boxModel[5]) / (2 * this._screenDPI)); this._client.send('Input.dispatchMouseEvent', { type: 'mouseMoved',