Hi,
I have found the information that since chrome 75+ consecutive file uploads are handled a bit differently. Now the files were added to the input, which means, that when uploading three files, the first file is uploaded three times, the second twice, and the last one once. This is because an added file persists and is re-uploaded with the subsequent one. Then I have read that several files can be uploaded at once, by chaining the paths (\n) together. This works fine.
This was the code before
sectionMediaContent.setValue('@fileUpload', require('path').resolve(__dirname + '/../../../../etc/upload/audioMedium/01_audioMedium_MP3_L-0.02Min_B-40kBits_C-Mono_SR-22.05kHz_S-10.5KB.mp3'));
sectionMediaContent.setValue('@fileUpload', require('path').resolve(__dirname + '/../../../../etc/upload/audioMedium/02_audioMedium_MP3_L-0.02Min_B-40kBits_C-Stereo_SR-22.05kHz_S-10.5KB.mp3'));
This is the code now
sectionMediaContent.setValue('@fileUpload', require('path').resolve(
__dirname + '/../../../../etc/upload/audioMedium/01_audioMedium_MP3_L-0.02Min_B-40kBits_C-Mono_SR-22.05kHz_S-10.5KB.mp3' + '\n' +
__dirname + '/../../../../etc/upload/audioMedium/02_audioMedium_MP3_L-0.02Min_B-40kBits_C-Stereo_SR-22.05kHz_S-10.5KB.mp3'));
Problem
In my test suites, several uploads are performed in different test cases. So I have to empty the file input somehow before the next upload is triggered. I have tried different things but did not find a proper solution.
- .sectionMediaContent.clearValue('@fileUpload') - did not work
- .sectionMediaContent.setValue('@fileUpload', '') - did not work
Can someone help me and has a solution for my reset input problem?
Environment
"chromedriver": "76.0.1",
"html-dnd": "1.2.1",
"nightwatch": "1.2.1",
Config (for local testing)
{
"src_folders": ["tests"],
"globals_path": "globals.chris.js",
"page_objects_path": "page-objects",
"webdriver" : {
"start_process": false,
"host": "localhost",
"port": 4444
},
"test_settings": {
"default": {
"skip_testcases_on_fail": false,
"webdriver": {
"port": 9515,
"default_path_prefix": ""
},
"desiredCapabilities": {
"browserName": "chrome",
"chromeOptions" : {
"args" : [
"--start-maximized"
]
},
"acceptSslCerts": true
}
}
}
}
Any help is appreciated!
Regards, Chris