question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2.1.0 and 2.1.1 uploadFile failing

See original GitHub issue

I have this code: (via codeceptjs)

    async attachFile(locator, pathToFile) {
      const file = path.join(global.codecept_dir, pathToFile);

      if (!fileExists(file)) {
        throw new Error(`File at ${file} can not be found on local system`);
      }
      const els = await findFields.call(this, locator);
      assertElementExists(els, 'Field');
      await els[0].uploadFile(file);
      return this._waitForAction();
    }

In in 2.0.0 this works but in 2.1.0 and 2.1.1 this no longer works.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
yurynixcommented, Feb 24, 2020

This works for me as workaround on: 80.0.3987.0 puppeteer-core version: 2.1.1 79.0.3945.0 puppeteer-core version: 2.1.0

  const uploadInput = await page.$(someSelector)
  const filePath = path.join(__dirname, fileRelativePath);
  await uploadInput.uploadFile(filePath);
  await page.evaluate((inputSelector) => {
    document.querySelector(inputSelector).dispatchEvent(new Event('change', { bubbles: true }));
  }, someSelector)

So maybe something like https://github.com/puppeteer/puppeteer/pull/5446 is in order?

3reactions
swftvsncommented, Feb 18, 2020

Same here, uploads fail with 2.1.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

jsf 2.1 cant import <h:inputfile - file upload - Stack Overflow
I need to fix this problem an make available to my pages the inputfile tag. If i use primefaces inputfile still the page...
Read more >
Patch 1 update for vRealize Suite Lifecycle Manager 2.1 (68067)
Upgrading vRA from vRSLCM pre-check fails with Java 8 update 201 or later must be installed. 3, If shortname is used for accessing...
Read more >
How to upload a file from Angular 5 to ASP.NET Core 2.1 Web ...
NET Core 2.1 Web API with showing the file upload progress status. ... return Json("Upload Failed: " + ex.Message);.
Read more >
Release Notes - Legal Text Collector
... 2020; 2.1.2 – June 22, 2020; 2.1.1 – May 20, 2020; 2.1.0 – May 16, 2020 ... Handle AT&T Advanced messages that...
Read more >
BIG-IP 15.1.2.1 Fixes and Known Issues - AskF5 - F5 Networks
899009, 3-Major, Azure Active Directory deployment fails on BIG-IP 15.1 ... If you are using SOAP to upload BIG-IP software images, upload them...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found