Katalon always launches Chrome for Testing with "No protection" in security preventing certain downloads

In my project I have a test that requires Chrome for Testing to click a link to download a certificate (.cer) file. Chrome for Testing prevents this download (see image). The browser displays a message which claims that I need to have an elevated security setting level to download the file, but when I launch Chrome for Testing manually (with the .exe file) and set security to No Protection, the file still downloads fine… so the security level does not seem to be the real reason it is prevented from being downloaded.

The only time Chrome for Testing prevents the .cer file from being downloaded is when Katalon launches it. Anyone have ideas on how to get Chrome for Testing, launched by Katalon, to download this file type?

Screenshot 2024-08-13 110210

1 Like

Hi there,

Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.

Thanks!

To open browser, do you call

  • “WebUI.openBrowser()”
  • or “new ChromeDriver()”

These two methods work quite differently. You should make it clear to us.

As far as I know, KatalonStudio launches “Chrome” by WebUI.openBrowser() keyword as default; it does not lauch “Chrome for Test” unless you customly configured your project.

How did you configured your katalon project? Please show your code.

Can you add desired capabilities and check once again

options = Options()
options.add_experimental_option("prefs", {
  "download.default_directory": "C:\Users\xxx\downloads\Test",
  "download.prompt_for_download": False,
  "download.directory_upgrade": True,
  "safebrowsing.enabled": True,
  "profile.default_content_setting_values.automatic_downloads": 2,
    })

Hi dineshh,

Are these things that I should add to the desired capabilities for chrome? Or is this code I should add to my browser launcher script? Sorry, I’m just not sure how to use that. Thank you! I am just launching chrome for testing with this:

WebUI.openBrowser(GlobalVariable.LS_Server_IP)
WebUI.maximizeWindow()

This is where I was trying to add a few basic launch arguments but they didn’t seem to work with chrome for testing.

There seems to be an ‘r’ in the line specifying the default directory in your code, should that be there? I removed that character from your code when adding it to my script. When I added your snippet to my script file the font colors changed of commands so it makes me think maybe something isn’t right?

This is how the fonts look before adding your snippet:

This is what my desired capabilities properties file looks like; it has one item added, but that launch argument has in impact sadly.

{“CHROME_DRIVER”:{“binary”:“c:\Program Files\Google\Chrome for Testing\Chrome-Win64\Chrome.exe”,“args”:[“–safebrowsing-enable-standard-protection”]}}

I just tried adding them to the desired capabilities, it didn’t seem to fix the issue (maybe I am doing it wrong so I just thought i’d try this)

I found a red underline in the screenshot you shared above.

In a Groovy script, in a string literal, a backslash character \ must be escaped by a backslash character prepended

Wrong:

"C:\Users\admin\downloads"

Right

"C:\\Users\\admin\\downloads"

See the Groovy doc here

please try the above solution