1
const { test, expect } = require('@playwright/test');
test.only('Login 1', async ({ page }) => {
  await page.goto('my login page');
  await page.fill('input[name="userId"]', 'my userId');
  await page.fill('input[name="password"]', 'my password');
  await page.locator('#idPasswordInputForm a.input_area_btn_01').click({timeout: 30000});
})

I use above code to test login on my page automatically. However, after it runs to this line: await page.locator('#idPasswordInputForm a.input_area_btn_01').click({timeout: 30000}); on debug mode, It stuck on this step: waiting for scheduled navigations to finish.

Login on my page still works fine if I login manually.

Have I mistake something and how to fix it?

3
  • Can you share a reproducible version of the page, or the page itself, so the code can be run and experimented with? There's nothing obviously incorrect with the code taken in isolation--the issue is in the specific page's behavior that might force you to use a different coding strategy, but there's no telling what that might be. Using .evaluate(el => el.click()) is a typical workaround for visibility.
    – ggorlen
    Commented Feb 5 at 4:40
  • 1
    Thank for your reply. This is the page to test: 'salonboard.com/login'. You can random any userId and password to login. Because in my case, it stuck on waiting for scheduled navigations to finish.
    – Tung Le
    Commented Feb 5 at 4:51
  • 1
    Thanks, seems like some weird page-specific behavior where it simply doesn't navigate if you're in Playwright. It's probably detecting the robot using a trickier method than user agent. I'm not sure how to bypass this offhand.
    – ggorlen
    Commented Feb 5 at 22:24

0

Browse other questions tagged or ask your own question.