Rayrun
← Back to Discord Forum

page.waitForSelector().then() dont work

await page.getByRole('button', { name: 'Modify Master #1' }).click()

        await page.waitForSelector('div', { name: 'Modify Master Channel #1' }).then(async () => {
            console.log(await page.getByText('Master Channel:').locator('..').evaluate(elem => elem.outerHTML))
        })

when I click the button, the discord embed change, but the page doesn't update the new elements

This thread is trying to answer question "Why is page.waitForSelector().then() not working properly to update elements on a page after clicking a button?"

2 replies

@GUZR try this await page.getByRole('button', { name: 'Modify Master #1' }).click();

await page.waitForSelector('div[name="Modify Master Channel #1"]');

console.log(await page.getByText('Master Channel:').locator('..').evaluate(elem => elem.outerHTML));

still not working

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 [email protected].