Using the code below the test passes the first assertion as expected and fails on the second assertion citing locator('html').locator(locator('body')) as the locator.
Normally the locator cited can be copied into the inspector to check the locator, however it does not recognise
locator('html').locator(locator('body'))
You need to manipulate this locator string to this:
locator('html').locator('body')
test('test', async ({ page }) => {
await page.goto('https://www.google.com/');
let html = page.locator("html")
let body = page.locator("body")
let bodyCombined = html.locator(body)
//Passes
await expect(bodyCombined).toContainText("About")
//Fails citing "locator('html').locator(locator('body'))"
await expect(bodyCombined).toContainText("About1111")
});
Expected behavior
I expect locator('html').locator(locator('body')) to highlight the element in the playwright inspector
OR
The locator cited in the error to show locator('html').locator('body')
(this is less perferrable)
Actual behavior
locator('html').locator(locator('body')) cited in the error returns nothing when using it in the playwright inspector
Version
1.44.1
Steps to reproduce
Using the code below the test passes the first assertion as expected and fails on the second assertion citing
locator('html').locator(locator('body'))
as the locator.Normally the locator cited can be copied into the inspector to check the locator, however it does not recognise locator('html').locator(locator('body'))
You need to manipulate this locator string to this: locator('html').locator('body')
Expected behavior
I expect locator('html').locator(locator('body')) to highlight the element in the playwright inspector
OR
The locator cited in the error to show
locator('html').locator('body')
(this is less perferrable)Actual behavior
locator('html').locator(locator('body')) cited in the error returns nothing when using it in the playwright inspector
Additional context
No response
Environment