Download files from web ui not working

hi !

many thanks :smiley: . this works and this is my Dictionary.

But there are more questions:
**what should i do to test this also with Chrome, IE, Safari etc.?
**what are the names of the profiles ?
thanks for your support

tom

dict3.JPG

Hello,

This answer is great and worked for me also.
But I am also lobby-ing for other browser profile configurations: Chrome, IE, Safari, where possible.

Thank you,
Cornel Neacsu

Cornel Neacsu said:

Hello,

This answer is great and worked for me also.
But I am also lobby-ing for other browser profile configurations: Chrome, IE, Safari, where possible.

Thank you,
Cornel Neacsu

For Chrome: You should pass it like this: Download files in Chrome browser using selenium WebDriver - qavalidation

IE & Safari doesn’t provide automatic download, so you need to handle this by yourself using scripting I believe

Screen Shot 2018-01-23 at 09.47.46.png

1 Like

Unsure what I need to do in order to get the Chrome download go to into a specific folder? I see the link above, but unsure where to place this and how to pass a folder to download into. We only use Chrome for our testing at this time. What are the arg values for the above screenshot?

Thank you for any assistance.

Dave

1 Like

Can you please help how to handle download in Internet Explorer? As i got tomorrow last day to present in front of manager to get approval for Katalon in our company.
Need your Urgent help.

Dave Weil said:

Unsure what I need to do in order to get the Chrome download go to into a specific folder? I see the link above, but unsure where to place this and how to pass a folder to download into. We only use Chrome for our testing at this time. What are the arg values for the above screenshot?

Thank you for any assistance.

Dave

Hi,

This one is as well my problem before. And it took me weeks to solve. Got them solved (with God’s help). See below Desired Capabilities applied in Chrome execution settings:


prefs contains:
profile.default_content_settings.popups | Number | 0
download.default_directory | String | C:\Shared - you can change the path to your desired location

args contains:
String | --test-type
String | --disable-extensions

Hope this helps.

My problem now is how to set the filename accdg to my preference. That, i am still working on.

image.png

2 Likes

tom said:

hi !

many thanks :smiley: . this works and this is my Dictionary.

But there are more questions:
**what should i do to test this also with Chrome, IE, Safari etc.?
**what are the names of the profiles ?
thanks for your support

tom

Hi all,

I added application/pdf as Value for browser.helperApps.neverAsk.saveToFile but the dialog still pops up when the test click on the download icon.

Anyone encounter this as well?

Many thanks for any solution/suggestion given.

For me also, while downloading the pdf the dialog box gets opened up as the test clicks on the download icon.
Could you please help in downloading a pdf file

4 Likes

Eileen said:

tom said:

hi !

many thanks :smiley: . this works and this is my Dictionary.

But there are more questions:
**what should i do to test this also with Chrome, IE, Safari etc.?
**what are the names of the profiles ?
thanks for your support

tom

Hi all,

I added application/pdf as Value for browser.helperApps.neverAsk.saveToFile but the dialog still pops up when the test click on the download icon.

Anyone encounter this as well?

Many thanks for any solution/suggestion given.

In firefox_profile map, Add setting: pdfjs.disabled || True

1 Like

Marivic E. Lorilla said:

Dave Weil said:

Unsure what I need to do in order to get the Chrome download go to into a specific folder? I see the link above, but unsure where to place this and how to pass a folder to download into. We only use Chrome for our testing at this time. What are the arg values for the above screenshot?

Thank you for any assistance.

Dave

Hi,

This one is as well my problem before. And it took me weeks to solve. Got them solved (with God’s help). See below Desired Capabilities applied in Chrome execution settings:


prefs contains:
profile.default_content_settings.popups | Number | 0
download.default_directory | String | C:\Shared - you can change the path to your desired location

args contains:
String | --test-type
String | --disable-extensions

Hope this helps.

My problem now is how to set the filename accdg to my preference. That, i am still working on.

It does not work for me :frowning:

The following settings worked for me on

Google Chrome 66.0.3359.181


where perfs contains the following settings

Below is what my groovy script looks like


'Define Custom Path where file needs to be downloaded'
String downloadPath = 'C:\\temp'
'Wait for Some time so that file gets downloaded and Stored in user defined path'
WebUI.delay(10)
'Verifying the file is download in the User defined Path'
Assert.assertTrue(isFileDownloaded(downloadPath, '.csv'), 'Failed to download Expected document')
WebUI.closeBrowser() //Iterating a loop for number of files available in the folder to verify file name in the folder
boolean isFileDownloaded(String downloadPath, String fileName) {
    boolean flag = false
    'Creating an object for File and passing the download Path as argument'
    File dir = new File(downloadPath)
    'Creating an Array where it will store all the files from that folder'
    File[] dir_contents = dir.listFiles()
    for (int i = 0; i < dir_contents.length; i++) {
        println('File Name at 0 is : ' + dir_contents[i].getName())
        'Verifying the file name is available in the folder '
        if (dir_contents[i].getName().contains(fileName)) {
            'If the file is found then it will return a value as true'
            return flag = true
        }
    }
    
    'If the file is found then it will return a value as false'
    return flag
}

2018_05_26_03_09_59_Project_Settings.png

2018_05_26_03_10_53_Katalon_Studio_CommandCenterEnterpriseRegression_Location_C_Users_imran_K.png

2 Likes

In firefox_profile map , I have the next dictionary:
with pdfjs.disable true, the file didn’t download, but if i don’t write this preference the download file popup is opened. I am using an image button

The code in the script to download the file is:

if (true) {

WebUI.waitForElementClickable(findTestObject(‘Page_Servicio de Rentas Internas/img’), 2)

if (true) {

//Dar click sobre el icono pdf para descargar el archivo’

WebUI.click(findTestObject(‘Page_Servicio de Rentas Internas/img’))

//Esperar para que el archivos se descargue en el path definido por el usuario

WebUI.delay(10)

}

}

how can i download the file without to see the popup opened?

firefox_profile_dictionary.png

I am using similar settings for chrome, but unable to download, Do i also need some code in this case other than settings…In my case file is getting opened in another chrome window where i have to click on download button to save it to a particular folder…Please help!

Untitled.png

screen.png

Carlos Fontana said:

Marivic E. Lorilla said:

Dave Weil said:

Unsure what I need to do in order to get the Chrome download go to into a specific folder? I see the link above, but unsure where to place this and how to pass a folder to download into. We only use Chrome for our testing at this time. What are the arg values for the above screenshot?

Thank you for any assistance.

Dave

Hi,

This one is as well my problem before. And it took me weeks to solve. Got them solved (with God’s help). See below Desired Capabilities applied in Chrome execution settings:


prefs contains:
profile.default_content_settings.popups | Number | 0
download.default_directory | String | C:\Shared - you can change the path to your desired location

args contains:
String | --test-type
String | --disable-extensions

Hope this helps.

My problem now is how to set the filename accdg to my preference. That, i am still working on.

It does not work for me :frowning:

Did you insert step to click download button??
Here is the setting should exactly look like, if you find it hard to follow above instruction.

download.png

Girish Mohite said:

I am using similar settings for chrome, but unable to download, Do i also need some code in this case other than settings…In my case file is getting opened in another chrome window where i have to click on download button to save it to a particular folder…Please help!

Try using sendkey - CONTROL + S :slight_smile:

Hi all,

The above solution worked for me. But can anyone tell me how can i enable download popup in chrome browser.

i have done -
download.prompt_for_download as true

still i didn’t get popup.

Thanks in advanced!!

Hi all,

I can’t solve my download problem.
I am using Katalon studio version 5.6.3 and
Chrome Version 68.0.3440.106 (Official Build) (64-bit).
I have same problem like @Girish Mohite
When i click on download button new window is opened.
I cant record anything with SPY WEB on that new window. That means i cant click on download button. That is why i tried to simulate CTRL + S, but since i cant record anything on that new windows i cant sendKeys to object.
So i used robot class.
When i simulate CTRL+S with robot class SAVE AS windows appears.
Is there anything i can do to to avoid SAVE AS dialog?

My Chrome settings:

Chrome_settings.PNG

Thank you so much. This worked for me :slight_smile:

Hi,

This one is as well my problem before. And it took me weeks to solve. Got them solved (with God’s help). See below Desired Capabilities applied in Chrome execution settings:


prefs contains:
profile.default_content_settings.popups | Number | 0
download.default_directory | String | C:\Shared - you can change the path to your desired location

args contains:
String | --test-type
String | --disable-extensions

Hope this helps.

My problem now is how to set the filename accdg to my preference. That, i am still working on.

1 Like

Hi, @Zarashima

I had followed the step, to put the dictionary in firefox_profile. However, I still get the pop up. Is there any mistake I made?.

Thanks in advance. :slight_smile:

Hello all,

it still not working with me too
i am using: Firefox 64.0.2 (64-bit), Katalon Studio Version: 5.10.1 Build: 1, Win 7/64

thanks for your kind of help.
roy