Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Get the locator from the intersection of the locators #559

Discussion options

Hi, I would like to build a custom locator based on existing ones. Something like this:

const cellLocator = createCellLocator({ 
 row: page.locator('data-rowindex="1"'), 
 column: page.locator('[role=columnheader]', { hasText: 'Description' }) 
})
function createCellLocator({ row, column }: { row: Locator, column: Locator }) {
 // ...
}

I can't find any solution which is close to this. Is there a way how to do it? The custom selector engine is relatively close to that but the issue is that I can't reuse existing selector engines or at least I don't know how.

You must be logged in to vote

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MatejBransky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /