Change Download Path

Hello,

I am doing a test that downloads the file, reads it and then deletes it using the following code:

WebUI.waitForElementClickable(findTestObject(‘/button_download2’), 2)

WebUI.click(findTestObject(‘/button_download2’))

WebUI.delay(4)

File fileReport = new File(‘C:/Users/Downloads/report.csv’)

String data = FileUtils.readFileToString(fileReport)

boolean fileSuccessfullyDd = new File(‘C:/Users/Downloads/report_flux.csv’).delete()

System.out.println(fileSuccessfullyDd)
I also updated the Desired Capability

How can I change the download path ?

ANY Help Please !!

1 Like

Hi @fzacraoui, Please see this post: Finding user's "Downloads" folder & Katalon project's "Data Files" folder relative to the project folder - #5 by Dave_Evers

2 Likes

Thank you for your reply.
This code returns the path of the project as well as the path in which the download file would be put.
But the file is always downloaded on the default path C:/Downloads and not the Data Files file.
Is there a modification to be made at the level of the setting> Desired Capabilities?

1 Like

for this , you need to change your desired path from chrome browser-> setting->Downloads

2 Likes

It’s work with this

1 Like