webdriverio: [🐛 Bug]: Error clicking in "a" element in chromedriver version 103

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

7.16.13

Node.js Version

15.14.0

Mode

WDIO Testrunner

Which capabilities are you using?

browserName: 'chrome',
        'goog:chromeOptions': {
            args: [
                '--disable-infobars',
                '--no-sandbox',
                '--disable-gpu',
                '--disable-setuid-sandbox',
                '--disable-dev-shm-usage',
                '--window-size=1920,1080'
            ],
            prefs: {
                ['profile.default_content_setting_values.images']: 2
            }
        }


S.O: Windows 10

What happened?

I updated chromedriver version from 102 to 103 due to chrome updated the version and the behavior that worked before the upgrade not it’s not working properly now.

The situation:

  1. I open a main page where I have a lot of link to click
  2. I find a specific link with a xpath
  3. I click in the link found previously, no problem to found the xpath.
  4. The driver click in the link
  5. Open the next page associated to the link
  6. Fail with a timeout because it’s not possible to click in the previous link. Make not sense because the driver clicked in the link before

What is your expected behavior?

No timeout trying to click in the link. The same code works with following version:

  • Chrome: 101, Chromedriver 101
  • Chrome 102 , Chromederiver 102

How to reproduce the bug.

In a cucumber step click in “a” element in html

This is more or less the code to reproduce

Scenario: Click in link
 Given I click in link

Given('I select sale {string} on landing page', async function (sale: string) {
    const commonPage = new CommonPageObject();
    await commonPage.clickSaleOnLandingPage(saleData);
});

   async clickSaleOnLandingPage(saleData: IAuctionEvent) {
         await (await this.specificSaleOnLandingPage(saleData)).click();   
    }

  async specificSaleOnLandingPage(saleData: IAuctionEvent): Promise<WebdriverIO.Element> {
        return $(`//a[contains(@href, "/sso?SaleID=${saleData.saleId}&SaleNumber=${saleData.saleNumber}")]`);
    }

Relevant log output

1) Sale Page labels in "English" language And I select sale "AUCTIONEVENT-SWITZERLAND" on landing page
[chrome 103.0.5060.66 windows #0-2] Error: Can't call elementClick on element with selector "//a[contains(@href, "/sso?SaleID=28937&SaleNumber=19645")]" because element wasn't found
[chrome 103.0.5060.66 windows #0-2] Error: Can't call elementClick on element with selector "//a[contains(@href, "/sso?SaleID=28937&SaleNumber=19645")]" because element wasn't found
[chrome 103.0.5060.66 windows #0-2]     at implicitWait (C:\Dev\git\Christies\AutomationTest\node_modules\webdriverio\build\utils\implicitWait.js:34:19)
[chrome 103.0.5060.66 windows #0-2]     at async C:\Dev\git\Christies\AutomationTest\node_modules\webdriverio\build\utils\refetchElement.js:29:16
[chrome 103.0.5060.66 windows #0-2]     at async Element.elementErrorHandlerCallbackFn (C:\Dev\git\Christies\AutomationTest\node_modules\webdriverio\build\middlewares.js:41:37)
[chrome 103.0.5060.66 windows #0-2]     at async Element.elementErrorHandlerCallbackFn (C:\Dev\git\Christies\AutomationTest\node_modules\webdriverio\build\middlewares.js:24:32)
[chrome 103.0.5060.66 windows #0-2]     at async Element.runCommandWithHooks (C:\Dev\git\Christies\AutomationTest\node_modules\@wdio\sync\build\wrapCommand.js:105:25)
[chrome 103.0.5060.66 windows #0-2]     at Element.runCommandWithHooks (C:\Dev\git\Christies\AutomationTest\node_modules\@wdio\sync\build\wrapCommand.js:100:24)
[chrome 103.0.5060.66 windows #0-2]     at Element.wrapCommandFn (C:\Dev\git\Christies\AutomationTest\node_modules\@wdio\sync\build\wrapCommand.js:67:44)
[chrome 103.0.5060.66 windows #0-2]     at Element.<anonymous> (C:\Dev\git\Christies\AutomationTest\node_modules\@wdio\utils\build\shim.js:270:24)
[chrome 103.0.5060.66 windows #0-2]     at Element.elementErrorHandlerCallback (C:\Dev\git\Christies\AutomationTest\node_modules\webdriverio\build\middlewares.js:48:12)
[chrome 103.0.5060.66 windows #0-2]     at CommonPageObject.<anonymous> (C:\Dev\git\Christies\AutomationTest\src\pageObject\commonPageObject.ts:35:19)
[chrome 103.0.5060.66 windows #0-2]     at fulfilled (C:\Dev\git\Christies\AutomationTest\src\pageObject\commonPageObject.ts:5:58)
[chrome 103.0.5060.66 windows #0-2]     at processTicksAndRejections (node:internal/process/task_queues:94:5)

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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (17 by maintainers)

Most upvoted comments

@praveendvd that shouldn’t be needed though, especially since that bug is resolved. It might be that it is reintroduced by accident.

EDIT: also the element isn’t inside an iframe so I see no reason as to how this is connected

Sure, I can test this later today and will report the findings here

Apologies, I accidentally ran the above with puppeteer instead of chromedriver. When using Chromedriver this is indeed an issue and I would say that this seems to be an issue in the Chromedriver and not with WebdriverIO, would you agree @christian-bromann ?