Selenium FileUpload accept() is not clicking button
Asked Answered
L

1

0

Having opened the file chooser dialog in IE,

self.webDiver.switch_to_alert().accept()

Tried the above line but does not click the open button.

IE Version 11.2580.14393.0;

Windows Server 2016 Standard

The dialog that gets displayed is "Choose File to Upload", this dialog has a File name text box with a Combobox + Open button as well as an Open button that is a SplitButtonControl with options to Open/Open readonly or save as previous version.

Lexeme answered 15/11, 2018 at 6:32 Comment(2)
Is this a question or an answer?Arnulfoarny
Fixed question and answer.Lexeme
L
0

Edge and chrome version 83 alerts for a OAuth or Single Sign on User Credentials are a special case of Alert.

Dialog window is not part of the Browser, its a Operating system dialog (some technicalities are glossed over here) and launches in a separate process.

I was unable to find a Selenium method for interacting with Windows Dialog so used python uiautomation for windows instead:

window2 = uiautomation.WindowControl(searchDepth=1, ClassName='Credential Dialog Xaml Host')
window2.SetActive()
window2.SendKeys('username{TAB}password')
window2.ButtonControl(searchDepth=10, Name='OK').Click()
Lexeme answered 19/11, 2018 at 1:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.