Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Is it possible to work with element inside another element ?

Open
#2,780 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
25/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, playwright
Domain
testing

Research direction

Start by reviewing the documented element APIs referenced in the issue, especially element.click(), Playwright._locate, and the proposed grabTextFrom('h2') usage. Clarify whether nested element queries are supported and document the correct usage or limitation with an example; done means the question is answered in the documentation.

Written by the indexing model from the issue text.

Description

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

Dominant language
JavaScript
Stars
4.2k
Forks
756
Avg merge
2d 9h
Merged PRs (30d)
16

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from codeceptjs/CodeceptJS

All issues in codeceptjs/CodeceptJS

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.