Skip to content

Commit 18a94fd

Browse files
committed
fixed elements highlight in responsive websites
1 parent 11d5ed1 commit 18a94fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/selenium-api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3632,8 +3632,8 @@ Selenium.prototype.doShowElement = function(locator){
36323632
try{
36333633
const highlightElement = document.getElementById("selenium-highlight");
36343634
let element = this.browserbot.findElement(locator);
3635-
const elementRects = element.getClientRects()[0];
3636-
const bodyRects = document.body.getClientRects()[0];
3635+
const elementRects = element.getBoundingClientRect();
3636+
const bodyRects = document.documentElement.getBoundingClientRect();
36373637
highlightElement.style.position = "absolute";
36383638
highlightElement.style.zIndex = "100";
36393639
highlightElement.style.display = "block";

0 commit comments

Comments
 (0)