Skip to content

[page.click] Node is either not visible or not an HTMLElement  #1990

@JonnyLeiZhang

Description

@JonnyLeiZhang

Context:

Playwright Version: 0.15.0
Operating System: Ubuntu 18.04.4

Code Snippet

(async () => {
  // below lines used to create a profile with name 'add_profile_test'
  await page.click('#add-profile-btn');
  await page.fill('#profile input[type=text]','add_profile_test');
  await page.click('#dialog-btn');
  // after create it, then select it
  await page.waitForSelector('text=add_profile_test', {waitFor: 'visible',});
  await page.click('text=add_profile_test');
})

Describe the bug

when try to click the element ('text=add_profile_test'), it reports 'Node is either not visible or not an HTMLElement'.
but if I add one line page.waitFor(1000) before await page.click('text=add_profile_test'), then it can work, I don't understand why. Shouldn't waitForSelector and waitFor function work for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions