0

I am trying to launch file choose dialog by clicking on 'Choose File' button in a web portal. The click event happens, but the dialog is not displayed. Even if we click on the 'Choose File' button manually in the driver browser instance, the file choose window doesn't show up.

How can i enable the safaridriver to allow and show the file explorer (File chooser) during execution in Python?

Below is the code I have used to initialize safari driver

global driver
   if (props['Browser']=="Safari"):
       driver = selenium.webdriver.Safari()
       driver.implicitly_wait(120)
Harish Kannan
  • 191
  • 1
  • 7
  • 17

1 Answers1

0

Safaridriver blocks any popup or file choose window by default. I couldn't find appropriate capabilities but send_keys method on the file input element worked.

If the input element is a file input, then send_keys should select that file for upload. Make sure the file name is proper without any spaces or symbols and appropriate escape characters.

Harish Kannan
  • 191
  • 1
  • 7
  • 17