File upload mimetype validation fails in Chrome launched by Chromedriver |
|||||
Issue descriptionWhat steps will reproduce the problem? [A] Test case 1 :- https://bugs.chromium.org/p/chromedriver/issues/detail?id=915 (1) Launch Chrome through Chromedriver (2) Navigate to the attached FileUpload.html page (3) Upload a valid .csv file by clicking on Choose field button. (4) Click on Submit WebDriver driver=new ChromeDriver(); driver.get("file:///path/to/FileUpload.html"); driver.findElement(By.id("grade_file")).sendKeys("/path/to/.csv file"); driver.findElement(By.tagName("form")).submit(); What is the expected output? File should be uploaded successfully. What do you see instead? Error message 'Please enter a value with a valid mimetype' is displayed. [B] Test case 2 :- https://bugs.chromium.org/p/chromedriver/issues/detail?id=1391 (1) Launch Chrome through Chromedriver (2) Navigate to the attached FolderUpload.html page (3) Upload a folder (containing 1 or more than 1 files) by clicking on Choose Files button. WebDriver driver=new ChromeDriver(); driver.get("file:///path/to/FolderUpload.html"); driver.findElement(By.id("uploadFolder")).sendKeys("/path/to/folder"); What is the expected output? Folder should be uploaded successfully. What do you see instead? Folder is not uploaded. It can verified in Chrome dev console. a) Press F12 to open dev console b) Run command "document.getElementById('uploadFolder').files" in console. => It does not show the list of files of the uploaded folder. Note - Above test cases works fine when performed manually (without chromedriver).
,
Jun 15 2016
,
Jun 16 2016
I think we should do something similar to FileInputType::filesChosen, maybe just call |m_inputType->filesChosen()| with correct file list.
,
Jun 20 2016
,
Jul 1 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7377ed7748106955dadd95ab254ddd86ae411c16 commit 7377ed7748106955dadd95ab254ddd86ae411c16 Author: einbinder <einbinder@chromium.org> Date: Fri Jul 01 20:55:33 2016 DevTools: protocol setting files properly handles mimetypes and directories. BUG= 620367 Review-Url: https://codereview.chromium.org/2098703003 Cr-Commit-Position: refs/heads/master@{#403524} [modify] https://crrev.com/7377ed7748106955dadd95ab254ddd86ae411c16/third_party/WebKit/Source/core/html/HTMLInputElement.cpp [modify] https://crrev.com/7377ed7748106955dadd95ab254ddd86ae411c16/third_party/WebKit/Source/core/html/HTMLInputElement.h [modify] https://crrev.com/7377ed7748106955dadd95ab254ddd86ae411c16/third_party/WebKit/Source/core/html/forms/FileInputType.cpp [modify] https://crrev.com/7377ed7748106955dadd95ab254ddd86ae411c16/third_party/WebKit/Source/core/html/forms/FileInputType.h [modify] https://crrev.com/7377ed7748106955dadd95ab254ddd86ae411c16/third_party/WebKit/Source/core/html/forms/FileInputTypeTest.cpp [modify] https://crrev.com/7377ed7748106955dadd95ab254ddd86ae411c16/third_party/WebKit/Source/core/html/forms/InputType.cpp [modify] https://crrev.com/7377ed7748106955dadd95ab254ddd86ae411c16/third_party/WebKit/Source/core/html/forms/InputType.h [modify] https://crrev.com/7377ed7748106955dadd95ab254ddd86ae411c16/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
,
Jul 1 2016
,
Jul 6 2016
Thanks for the fix! Tested both the test cases , looks good. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by gmanikpure@chromium.org
, Jun 15 2016Cc: samu...@chromium.org
Components: Platform>DevTools
Status: Available (was: Untriaged)