Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] File Upload leads to "Exactly one of payloads, localPaths and streams must be provided" #1468

Closed
nils-christian opened this issue Feb 1, 2024 · 1 comment · Fixed by #1469
Labels
bug Something isn't working

Comments

@nils-christian
Copy link

System info

  • Playwright Version: 1.40.0 - 1.41.1
  • Operating System: Windows
  • Browser: Chromium
  • Other info:

Source code

We are using the following code for a file upload:

final FileChooser fileChooser = page.waitForFileChooser( ( ) -> page.locator( "..." ).click( ) );
fileChooser.setFiles( new FilePayload( ... );

This works up to 1.39.0, but since 1.40.0 following error occurs:

com.microsoft.playwright.PlaywrightException: Error {
  message='Exactly one of payloads, localPaths and streams must be provided
  name='Error
  stack='Error: Exactly one of payloads, localPaths and streams must be provided
    at prepareFilesForUpload (<REDACTED>\playwright-java-13984471466917529150\package\lib\server\fileUploadUtils.js:41:75)
    at ElementHandle.setInputFiles (<REDACTED>\playwright-java-13984471466917529150\package\lib\server\dom.js:526:77)
    at ElementHandleDispatcher.setInputFiles (<REDACTED>\playwright-java-13984471466917529150\package\lib\server\dispatchers\elementHandlerDispatcher.js:148:38)
    at ElementHandleDispatcher._handleCommand (<REDACTED>\playwright-java-13984471466917529150\package\lib\server\dispatchers\dispatcher.js:84:40)
    at DispatcherConnection.dispatch (<REDACTED>\playwright-java-13984471466917529150\package\lib\server\dispatchers\dispatcher.js:351:39)
}

	at com.microsoft.playwright.impl.WaitableResult.get(WaitableResult.java:54)

We are using the docker image "yukinying/chrome-headless-browser-stable:120.0.6099.224" within Testcontainers for our tests, so this should be compatible with 1.41.1.

I will try and provide a self contained example for this, but I would still ask you to check whether you can confirm this issue.

Thank you and best regards

Nils

@yury-s
Copy link
Member

yury-s commented Feb 1, 2024

I'll cherry pick it into 1.41.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants