Skip to content

[🐛 Bug]: <webdriverio + edgedriver: The uploadFile command is not available in msedge> #12385

@d3m1art

Description

@d3m1art

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

7.25.2

Node.js Version

18.12.0

Mode

WDIO Testrunner

Which capabilities are you using?

{
      // 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: 5,
      //
      browserName: 'chrome',
      acceptInsecureCerts: true,
      // If outputDir is provided WebdriverIO can capture driver session logs
      // it is possible to configure which logTypes to include/exclude.
      // excludeDriverLogs: ['*'], // pass '*' to exclude all driver session logs
      // excludeDriverLogs: ['bugreport', 'server'],
      'goog:chromeOptions': {
        // extensions: [base64data],
        extensions: [base64Extension],
        prefs: {
          'download.default_directory': global.downloadDir,
        },
        args: [
          // `--disable-extensions-except=${pathToExtension}`,
          // `--load-extension=${pathToExtension}`,
          '--user-agent=ExtensionE2ETests',
        ],
      },
    },

What happened?

We use webdriverio + edgedriver to run autotests.

Our tests work in Chrome.
But in Edge:
Error: The uploadFile command is not available in msedge at Browser.uploadFile (\node_modules\webdriverio\build\commands\browser\uploadFile.js:50:15) at Browser.wrapCommandFn (\node_modules@wdio\utils\build\shim.js:137:38) at processTicksAndRejections (node:internal/process/task_queues:96:5)

Please advise us on how can we solve this problem to test the upload file functionality.

What is your expected behavior?

The test works properly in MS Edge

How to reproduce the bug.

export const setInputFile = async (filePath, file: WebdriverIO.Element) => {
  await browser.execute((el: any) => (el.style.display = 'block'), file);
  await file.waitForDisplayed();
  const remoteFilePath = await browser.uploadFile(filePath);
  await file.setValue(remoteFilePath);

  await browser.execute((el: any) => (el.style.display = 'none'), file);
};

Relevant log output

[MicrosoftEdge 122.0.2365.8 windows #0-4] The uploadFile command is not available in MicrosoftEdge
[MicrosoftEdge 122.0.2365.8 windows #0-4] Error: The uploadFile command is not available in MicrosoftEdge
[MicrosoftEdge 122.0.2365.8 windows #0-4]     at processTicksAndRejections (node:internal/process/task_queues:95:5)
[MicrosoftEdge 122.0.2365.8 windows #0-4]     at async setInputFile (/home/runner/work/chrome/chrome/e2e/lib/helpers/utils.ts:61:26)
[MicrosoftEdge 122.0.2365.8 windows #0-4]     at async Context.<anonymous> (/home/runner/work/chrome/chrome/e2e/specs/email-invoice/sending-invoice-with-attached-pdf.e2e.ts:29: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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🐛help 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