0

I'm using robot framework with selenium for automating my web application.

I'm trying to open chrome browser and download a XML file and then parse it from the results folder ${OUTPUT_DIR}.

Every time I'm trying to download any file, chrome browser shows the windows prompt to download the file. I tried using the chrome options to disable the prompt, but it is not working. Please find the piece of code used to invoke chrome browser.

When tried using the regedit - PromptForDownloadLocation variable, it is working fine.. but I want to manage this using chromeOptions

Could you please help me with this.

ChromeDriver version : 79.0.3945.36

Robotframework - SeleniumLibrary version : 3.3.1

Create Webdriver and Open Browser
   ${CHROME_OPTIONS} =    evaluate    sys.modules['selenium.webdriver'].ChromeOptions()    sys, selenium.webdriver
   ${prefs} =    create dictionary    download.prompt_for_download=${FALSE}    download.directory_upgrade=${TRUE}    download.default_directory=${OUTPUT_DIR}   safebrowsing.enabled=${TRUE}
   call method    ${CHROME_OPTIONS}    add_experimental_option    prefs    ${prefs}
   create webdriver    Chrome    chrome_options=${CHROME_OPTIONS}
A. Kootstra
  • 6,827
  • 3
  • 20
  • 43
dplvs
  • 43
  • 7
  • have you tried doing this in headless mode? – A. Kootstra Feb 11 '20 at 13:57
  • Hi @A. Kootstra, Headless mode is working fine, but headless mode is not the solution I'm intending to proceed ahead as I've to download zip, text and xml files using the links in my regular UI testcase. Thanks – dplvs Feb 11 '20 at 23:24

0 Answers0