Skip to content

[🐛 Bug]: Argument of type 'WebdriverIO.Element | Element' is not assignable to parameter of type 'Element' #11350

@bhanuagarwal73

Description

@bhanuagarwal73

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

8.16.20

Node.js Version

18.17.0

Mode

Standalone Mode

Which capabilities are you using?

capabilities: [{

        // maxInstances can get overwritten per capability. So if you have an in-house Selenium
        // grid with only 5 firefox instances available you can make sure that not more than
        // 5 instances get started at a time.
        maxInstances: 3,
        //
        browserName: runtimeArgs.browserName,
        browserVersion: runtimeArgs.browserVersion,
        acceptInsecureCerts: true,

        "goog:chromeOptions": {
            "args": ["user-agent=gcp-automation-test (Windows NT)",
                `${process.env.HEADLESS === 'true' ? '--headless' : undefined}`,
                `${process.env.HEADLESS === 'true' ? '--disable-dev-shm-usage' : undefined}`,
                `${process.env.HEADLESS === 'true' ? '--no-sandbox' : undefined}`,
                `${process.env.HEADLESS === 'true' ? '--window-size=1920,1080' : undefined}`
            ]
        },

        "bstack:options": runtimeArgs.service === 'browserstack' ? {
            "projectName": "merx-shopify-automation",
            "buildName": `${runtimeArgs.env} - ${runtimeArgs.brand} - ${runtimeArgs.suite} - ${runtimeArgs.browserName}`,
            "os": runtimeArgs.os,
            "osVersion": runtimeArgs.osVersion,
            "deviceName": runtimeArgs.device,
            "networkLogs": true,
            "consoleLogs": "errors",
            "browserVersion": "latest",
            "local": true
        } : {}
    }],

What happened?

Getting for error when calling elements array as below:

Argument of type 'WebdriverIO.Element | Element' is not assignable to parameter of type 'Element'.
Type 'Element' is missing the following properties from type 'Element': sessionStatus, sessionNew, sessionEnd, sessionSubscribe, and 25 more.ts(2345)

image
image

What is your expected behavior?

With v7 or when upgraded to v8 last month --> didn't see this issue. I guess need to change something with types file under webdriverio

How to reproduce the bug.

Just clone this https://github.com/bhanuagarwal73/Git-Merx.git
npm install
navigate & open file src/pageobjects/globalPage.page.ts --> see line 47 & 52

Relevant log output

No issue with run but seeing error in File

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