0

I would like to close poping up window in Selenium. During the test poping up window is not even active. I have tried getting list of tabs, but this poping window is not counted as a one of them. There is also no possibility found to get locator to close that window. screen[screen]

Bartek
  • 127
  • 6
  • Are you trying to download a file and don't want to display the saveAs pop-up? Can you mention the name of the browser – YaDav MaNish Jul 13 '21 at 14:02

1 Answers1

0

File upload & download dialogs belongs to operating system. That's why are those unreachable to selenium or any script. To avoid appearing download dialog you need to set up download automaticaly nested file mime type. There are two approaches to achieve it:

Option one, using dedicated browser profile:

  1. create manualy new browser profile
  2. run browser with the new profile
  3. setup manualy to automatic download files by type (pdf in this case)
  4. launch selenium with the dedicated browser profile

Option two, using custom desired capabilities, see How to download a pdf file in chrome using selenium webdriver

pburgr
  • 1,722
  • 1
  • 11
  • 26