Rayrun
โ† Back to Discord Forum

Fill unreliable on chrome

pauljbarry3posted in #help-playwright
Open in Discord

Hey all, I'm new to using Playwright, like it so far, until I ran into this issue. So I have a form where there is a text input. Once there is text entered into the input, a radio group appears. So I have code like await page.getByLabel("Price").fill("25.50") and I can see in the browser that sometimes that works and sometimes it doesn't. That line never fails, but the next line is await page.getByLabel("Yes").check({ timeout: 2000 }) and that line fails sometimes but I can see in the browser that the problem is it never appears because the value is never filled into the input. I can even manually fill a value into the input in the browser and then the radio group appears, but the problem is that since that value isn't really filled in, that radio group will never exist.

Has anyone seen issues like this before? Any tips on how to debug such a thing? It's on a pretty new project, so playwright 1.39.0. The app under test is a SvelteKit app. The test is running in the default Chromium browser. I'm running them on a Mac on Sonoma.

This thread is trying to answer question "Has anyone seen issues like this before? Any tips on how to debug such a thing?"

5 replies

Seems to be happening in chromium and webkit

So I wrote a similar test in Cypress and ran into the same problem. Now I think what I'm running into is this: https://github.com/sveltejs/svelte/issues/1755 - so it's just a race condition where sometimes hydration completes before the test starts type and other times it doesn't

So this isn't a Playwright issue, I think it's a Svelte issue

tphillips8117

That's a bit frustrating ๐Ÿ˜ฆ Will the field always be filled by the hydration? You could wait for the field to not be empty before you fill it

can you try with : https://playwright.dev/docs/api/class-locator#locator-press-sequentially From what I saw in the issue above, if this doesn't work, you may need to wait for something that indicates readiness of the page, or you can tell the devs to not show inputs that are not 'ready'

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.