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
blog for file upload example for V5 #3365
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3365 +/- ##
=======================================
Coverage 97.77% 97.77%
=======================================
Files 140 140
Lines 3010 3010
Branches 660 660
=======================================
Hits 2943 2943
Misses 63 63
Partials 4 4 Continue to review full report at Codecov.
|
Hi @caoxu2000 This might also help, I did an investigation for a customer of us and created this project. Currently I can't migrate it to V5 because there is a bug in the @wdio/firefox-profile-service, but the rest wouldn't change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some wording and formatting changes I would suggest.
Additionally I would love to add a section where the file command is used to upload a file to a remote Selenium standalone server (in case you don't run your test on the local machine).
@wswebcreation can you create an issue so we can get it fixed and extend this blog post with an example running on Sauce Labs?
|
||
```js | ||
// normal Nodejs stuff to create a variable pointing to the file | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link in my comment is already linking to the issue I created a few days ago, but here it is again #3297 |
Perhaps a more elegant solution than manually displaying a hidden
|
const filePath = path.join(__dirname, 'path/to/your/file'); | ||
|
||
// The css class name "upload-data-file-input hidden" is just an example and you can replace with your app. | ||
browser.execute('document.getElementsByClassName("upload-data-file-input hidden")[0].style.display = "block"'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason you aren't passing in the located web element as an argument?
Closing in favor of #3632 |
Proposed changes
Types of changes
Checklist
Further comments
Reviewers: @webdriverio/technical-committee