codeceptjs / codeceptjs/CodeceptJS

Is it possible to work with element inside another element ?

Offen
#2,780 3 Kommentare 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

I am wondering if it is possible to work with elements inside of other elements.

For example :
```
const blocks = await Playwright._locate(blocksSelector);

for(let i = 0; i < blocks.length; i++) {
const element = blocks[i]

// How can i grab text for all h2 (or other selectors) inside element ?
// Something like
// let text = element.grabTextFrom('h2');
// console.log(text)
}
```

The documentations only gives us example for `element.click()`

Thanks

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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