Bug 209780

Summary: Safari 13 pops up 'Glass Pane' when using Selenium sendKeys() to <input type="file"> element
Product: WebKit Reporter: Vikrant Kumar Chauhan <vikrant.lakshya>
Component: WebDriverAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Major CC: bburg, sourabhsrawat, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 13   
Hardware: Mac   
OS: macOS 10.15   
Attachments:
Description Flags
Glass pane when uploading file using Selenium's sendKeys() method.
none
Safari 13 Upload Issue Fixed.mov
none
Selenium Test Case with Java none

Description Vikrant Kumar Chauhan 2020-03-30 15:00:40 PDT
Created attachment 394969 [details]
Glass pane when uploading file using Selenium's sendKeys() method.

NOTE: The same thing is working as expected in Safari 12.1.2 but it's broken in Safari 13.0 & 13.1

Issue: System pops up 'Glass Pane' when using Selenium sendKeys() method to <input type="file"> element.

Background:
I want to upload a file (ex. image) in my application.

Expected result:
Since, this element

Safari 12.1.2 behaviour:
There is no need to simulate the clicking of the "Browse" button. SafariDriver automatically enters the file path onto the file-selection text box of the <input type="file"> element.

Safari 13 behaviour:
System pops up 'Glass Pane' when using Selenium sendKeys() method to <input type="file"> element.
Comment 1 Radar WebKit Bug Importer 2020-03-31 11:34:50 PDT
<rdar://problem/61117392>
Comment 2 BJ Burg 2020-03-31 11:50:18 PDT
I can't reproduce this issue, and none of our file upload tests are regressing. Please provide a publicly available test case that reproduces the bug. If you can't share publicly, then find me on WebKit Slack <https://webkit.org/getting-started/#staying-in-touch>, or file a report at https://feedbackassistant.apple.com/.
Comment 3 BJ Burg 2020-03-31 11:50:49 PDT
(In reply to Brian Burg from comment #2)
> I can't reproduce this issue, and none of our file upload tests are
> regressing. Please provide a publicly available test case that reproduces
> the bug. If you can't share publicly, then find me on WebKit Slack
> <https://webkit.org/getting-started/#staying-in-touch>, or file a report at
> https://feedbackassistant.apple.com/.

Also, please include the platform on which you are trying to do this.
Comment 4 BJ Burg 2020-03-31 11:51:32 PDT
Nevermind, I can't read, I see you are on Mac Safari.
Comment 5 Vikrant Kumar Chauhan 2020-03-31 12:55:34 PDT
Hi Brian,

This issue is always reproducible with Safari 13.0 & 13.1. Safari 12.1.2 is working fine. Please allow me some time. I'll figure out to attach a video or code snippet.

Thanks for consideration.

~ Vikrant
Comment 6 Sourabh Rawat 2020-05-06 03:23:21 PDT
Hi,

I am also facing the same issue, do you have any update on this?

Regards,
Sourabh
Comment 7 BJ Burg 2020-05-06 15:34:31 PDT
(In reply to Sourabh Rawat from comment #6)
> Hi,
> 
> I am also facing the same issue, do you have any update on this?
> 
> Regards,
> Sourabh

I am not able to reproduce this issue locally and nobody has offered a test case. So nothing has happened since the initial report.
Comment 8 Vikrant Kumar Chauhan 2020-05-06 17:13:24 PDT
NOTE: ISSUE IS NO LONGER REPRODUCIBLE ON CURRENT UPDATED SYSTEM

Environment: 
MacOS: Catalina 10.15.4 
Safari: 13.1 (15609.1.20.111.8)
Selenium: 3.141.59
Scripting Language: Java 1.8

Issue summary: Safari 13 pops-up 'Glass Pane' when using Selenium's sendKeys() method to <input type="file"> element.

Test Case: User wants to upload a file in <input type="file"> Element on Safari 13 using sendKeys() method.

Step to reproduce:
Launch URL of given HTML page which contains <input type="file"> element
Run test script and use pre-built 'sendKeys()’ method to send filepath to the web-element

Attachments: Sample HTML, Sample image, Sample Selenium-Java code to perform test.

Video recording is attached in which one can see that it’s working fine now on latest Safari build.
Comment 9 Vikrant Kumar Chauhan 2020-05-06 17:14:46 PDT
Created attachment 398684 [details]
Safari 13 Upload Issue Fixed.mov
Comment 10 Vikrant Kumar Chauhan 2020-05-06 17:18:57 PDT
Hey Sourabh,

This seems to be fixed for this setup:

MacOS: Catalina 10.15.4 
Safari: 13.1 (15609.1.20.111.8)
Selenium: 3.141.59
Scripting Language: Java 1.8
Comment 11 Vikrant Kumar Chauhan 2020-05-06 17:25:19 PDT
Created attachment 398685 [details]
Selenium Test Case with Java
Comment 12 Sourabh Rawat 2020-05-06 21:15:49 PDT
Thank Vikram for the update, I also have the same setup 

MacOS: Catalina 10.15.4 
Safari: 13.1 (15609.1.20.111.8)
Selenium: 3.141.59

Scripting Language python 2.0 

and I am still facing the issue, do you have any workaround for this?

Thanks,
Sourabh
Comment 13 BJ Burg 2020-05-07 10:51:24 PDT
(In reply to Sourabh Rawat from comment #12)
> Thank Vikram for the update, I also have the same setup 
> 
> MacOS: Catalina 10.15.4 
> Safari: 13.1 (15609.1.20.111.8)
> Selenium: 3.141.59
> 
> Scripting Language python 2.0 
> 
> and I am still facing the issue, do you have any workaround for this?
> 
> Thanks,
> Sourabh

This test case passes for me. I need to see logs of what happened on your machine where it fails. Please do the following to generate diagnostic traces (copied from safaridriver(1) man page) and attach to the radar, or email me:

"""
DIAGNOSTICS
     When filing a bug report against safaridriver, it is highly recommended that you capture and include diagnostics generated by safaridriver. This can be accomplished in
     several ways:

     To diagnose a single session, pass the safari:diagnose capability when requesting a new session.

     To diagnose all sessions from one safaridriver instance, use the --diagnose command line option.

     To diagnose all sessions in all instances of safaridriver, set the DiagnosticsEnabled default in the com.apple.WebDriver domain to YES using defaults(1).

     Diagnostic files are saved to ~/Library/Logs/com.apple.WebDriver/ and are uniquely named using the pid of safaridriver and a timestamp.  When using the safari:diagnose capa-
     bility to turn on diagnostics for a particular session, diagnostic files additionally include the session identifier in file names.
"""
Comment 14 BJ Burg 2020-05-07 10:52:06 PDT
[Attach to this bug* not radar 🤦🏼‍♂️]
Comment 15 Sourabh Rawat 2020-05-07 23:28:39 PDT
My issue is resolved, it was due to some other script I am using.
Thanks, Vikram for your time.

Regards,
Sourabh