codeceptjs / codeceptjs/CodeceptJS

Incosistent behaviour of grabElementBoundingRect in iframe

Offen
#2,770 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
4.2k
Forks
757
Ø Merge
2 T. 9 Std.
Gemergte PRs (30 T.)
16

Beschreibung

#### What are you trying to achieve?
I have an iframe somewhere on my page, with some elements inside it. I am using grabElementBoundingRect to check if an element in the iframe is within the current viewport of the iframe (ie if i have to scroll down to see the element).

I am running my tests mostly with Playwright, but also with WebDriver on some platforms (hello, IE users!)

#### What do you get instead?

The values returned by grabElementBoundingRect on elements within iframes differ between these WebDriver and Playwright. Playwright returns an absolute x/y position on the screen, while WebDriver returns an x/y position within the iframe.

```js
const elemRect = await within({frame: "#myIframe"}, () => {
return this.grabElementBoundingRect("#myElement");
});
```

### Details

* CodeceptJS version: 3.0.4
* NodeJS Version: v14.15.4
* Operating System: Ubuntu 18.04

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.