Rayrun
← Back to Discord Forum

"Target closed" when invoking locators from a page object class inside a test.step

Hello, I have this test laid out and working as expected as long as I don't use test.step. Once I try to group some statements inside of the test.step() I start to get "target closed" when trying to perform any action of the page locators, even though the page is part of the PageObject Classes.

Does anyone know if this might be something related to the scope of the test.step or maybe the fact that step is not receiving the page fixture?

image.png

This thread is trying to answer question "Why does the user get a 'target closed' error when trying to perform any action of the page locators inside a test.step()?"

1 reply

You don't await test.step.

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.