You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expect the test to pass and a locator to be generated
Actual behavior
An error is thrown by playwright.generateLocator:
Error: page.evaluate: SyntaxError: Invalid flags supplied to RegExp constructor ' >> nth=3'
at new RegExp (<anonymous>)
at createTextMatcher (<anonymous>:5935:16)
at Object.queryAll (<anonymous>:5004:29)
at InjectedScript._queryEngineAll (<anonymous>:4949:49)
at InjectedScript.querySelectorAll (<anonymous>:4936:30)
at generateSelector (<anonymous>:3649:32)
at InjectedScript.generateSelectorSimple (<anonymous>:4872:12)
at ConsoleAPI._generateLocator (eval at extend (:5100:40), <anonymous>:2241:43)
at Object.generateLocator (eval at extend (:5100:40), <anonymous>:2205:52)
at eval (eval at evaluate (:226:30), <anonymous>:6:34)
at createTextMatcher (/home/veith/projects/automagically/ts/apps/next-automagically/playwrightTests/reproduceBug/<anonymous>:5935:16)
at Object.queryAll (/home/veith/projects/automagically/ts/apps/next-automagically/playwrightTests/reproduceBug/<anonymous>:5004:29)
at InjectedScript._queryEngineAll (/home/veith/projects/automagically/ts/apps/next-automagically/playwrightTests/reproduceBug/<anonymous>:4949:49)
at InjectedScript.querySelectorAll (/home/veith/projects/automagically/ts/apps/next-automagically/playwrightTests/reproduceBug/<anonymous>:4936:30)
at generateSelector (/home/veith/projects/automagically/ts/apps/next-automagically/playwrightTests/reproduceBug/<anonymous>:3649:32)
at InjectedScript.generateSelectorSimple (/home/veith/projects/automagically/ts/apps/next-automagically/playwrightTests/reproduceBug/<anonymous>:4872:12)
at ConsoleAPI._generateLocator (/home/veith/projects/automagically/ts/apps/next-automagically/playwrightTests/reproduceBug/eval at extend (:5100:40), <anonymous>:2241:43)
at Object.generateLocator (/home/veith/projects/automagically/ts/apps/next-automagically/playwrightTests/reproduceBug/eval at extend (:5100:40), <anonymous>:2205:52)
at eval (/home/veith/projects/automagically/ts/apps/next-automagically/playwrightTests/reproduceBug/eval at evaluate (:226:30), <anonymous>:6:34)
at /home/veith/projects/automagically/ts/apps/next-automagically/playwrightTests/reproduceBug/reproduce.spec.ts:13:16
Version
1.43.1
Steps to reproduce
I have a copy of the HTML that causes the issue attached here: errored.html.txt
PWDEBUG=console npx playwright test
. PWDEBUG is required here to trigger the bug.Here is also a complete zip folder with all contents that you can just extract and run: reproduceBug.zip
The element I am trying to generate a Locator for is this:
or here highlighted in the chrome debug tools:
Expected behavior
I expect the test to pass and a locator to be generated
Actual behavior
An error is thrown by
playwright.generateLocator
:Possibly related: #26974
Additional context
Using the playwright recorder, I can not select this element, it just doesn't appear when hovering over the corresponding area.
Environment
The text was updated successfully, but these errors were encountered: