Skip to content

[🐛 Bug]: waitForDisplayed method does not work properly for Chrome #11710

@HannaTarasevich

Description

@HannaTarasevich

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

latest

Node.js Version

20.9.0

Mode

Standalone Mode

Which capabilities are you using?

{
browserName: 'chrome',
browserVersion: 'stable',
"w3c": false
}

What happened?

We have some elements that are displayed right after click on other element. Appeared pop-up contains target element (I can find it in the DOM and it always displays on the screenshots), but WDIO fails with error message that element is not clickable/interactable/displayed. It has started failing since 11/20. There were no any code changes from our side. We always use the latest WDIO on the pipeline. So, I had to downgrade the versions to 8.22.0 (webdriver, local-runner, cli) and now it works again.

I found out that using previous approach with await this.isElementDisplayed(this.elementId) (that was working for Chrome before #11681) fixes the issue.

I guess that previous approach included repeating in getting the element by id (and looks like page reinitialization each time), that current approach does not do so. Therefore, even if the element has appeared on the page in my app, it does not see it.

What is your expected behavior?

Element is found as displayed

How to reproduce the bug.

Unfortunately, I didn't find the way to reproduce this issue on some open-source apps.

Relevant log output

v23
2023-11-21T19:25:26.822Z INFO webdriver: COMMAND executeScript(<fn>, <object>)
2023-11-21T19:25:26.822Z INFO webdriver: [POST] http://0.0.0.0:49987/session/da5aa12ceff5f44bb622b633a7234d81/execute
2023-11-21T19:25:26.822Z INFO webdriver: DATA {
  script: 'isElementDisplayed(...) [8033 bytes]',
  args: [
    {
      'element-6066-11e4-a52e-4f735466cecf': '4684D05EC26DCDFA1BD83A49BDF17511_element_164',
      ELEMENT: '4684D05EC26DCDFA1BD83A49BDF17511_element_164'
    }
  ]
}
2023-11-21T19:25:26.833Z INFO webdriver: RESULT false
..
**_FAILURE_**


v22
2023-11-21T19:37:07.821Z INFO webdriver: COMMAND findElement("css selector", "div .k-multiselect")
2023-11-21T19:37:07.821Z INFO webdriver: [POST] http://0.0.0.0:51224/session/f7df37e8192d4936bfef514ad3a8390f/element
2023-11-21T19:37:07.821Z INFO webdriver: DATA { using: 'css selector', value: 'div .k-multiselect' }
2023-11-21T19:37:07.838Z INFO webdriver: RESULT { ELEMENT: '957A04CFD450AEA222A434341E72792B_element_162' }
2023-11-21T19:37:07.841Z INFO webdriver: COMMAND isElementDisplayed("957A04CFD450AEA222A434341E72792B_element_162")
2023-11-21T19:37:07.841Z INFO webdriver: [GET] http://0.0.0.0:51224/session/f7df37e8192d4936bfef514ad3a8390f/element/957A04CFD450AEA222A434341E72792B_element_162/displayed
2023-11-21T19:37:07.852Z INFO webdriver: RESULT true
..
**_PASSED_**

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🐛good first picka reasonable task to start getting familiar with the code basehelp wantedIssues that are free to take by anyone interested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions