Download file - Save As dialogue box in Control Tower


How can I get the xpath of the Save As dialogue box, to enter the path of the download when downloading a file in Control Tower?
I’m looking for a way to download the files (zip files) in a specific path or be able to set the default path specially when running in Control Tower. The solution in kb doesn’t work in Control Tower.



Hi @ssoleimani the dialogue box is not a part of the website, so it cannot be reached through XPath.
Is it actually a part of the Windows OS, so it can be automated using Enter Keystrokes and Mouse actions.

Note that if you have this option disabled in the Studio, you will need to switch to the window before using any actions in it.


Thanks for your response. Any sample code/ pseudo code is appreciated.



And one other issue is unfortunately when I tried the desired website automatically, it doesn’t show the dialogue box; after clicking the download button it downloaded automatically without popup the dialogue box Save As in Chrome or kind of footer notification in Internet Explorer, it just starts downloading the file in the default folder (c:/ user/ Download …).


Hi @ssoleimani,

Have you tried checking the option in Chrome Advanced Settings as shown below image,

Enabling this option will invoke Save As dialogue box whenever you click any download link and then you can perform insert keystrokes by entering your desired path and save files to that location.

Even it works executing in Control Tower for me if this option is enabled.

Please let me know if it works :slight_smile:

1 Like

@ssoleimani if you right-click on the link or document you need to save, does it open the context menu with an option Save As or Save Link As, etc?


Hi aravindhan_mr, Thanks for your response. The Save As dialogue box appears when I normally click on the download button but the problem I asked help for is it doesn’t show-up when run automatically. This setting is already active.


Hi ashapkina,
Thanks for your response. I tried it; when I right click on the download button there is an option to Save As but it doesn’t save the that I expected. it just want to save file.html and this doesn’t work for saving the file.


Try using this solution


Hi @ashapkina,

Actually I think you have given the same conception of what i have given in above reply.

Though you shared for Firefox Browser :slight_smile:

1 Like

Yes, it is the same :slightly_smiling_face:
I just thought it was worth mentioning that one needs to add the actions to change the settings at the beginning of the script as it opens a new browser instance every time.

1 Like

Hi @ssoleimani,

Could you please try with the Custom Action with “DownloadFileOnAgent” script?

If you could get Url path using Xpath in script or Mouse Right Click action and get the “Copy Link Address” and try it in script.


def customScript() {
	downloadFileOnAgent('', 'C:/Users/rr327591/Pictures/new-file.pdf');
} (97.8 KB)

This works for me even in Control Tower successfully.

Thanks for the response :slight_smile:

1 Like

Thanks so much for your response, actually I tried this before but the problem is this download button uses dynamic url that created with a post API method, so I cannot get the URL :confused:
I checked the other options You and ashapkina suggested, although it is set in my chrome’s setting to “Ask where to save each file before downloading” but when it runs by selenium this option is not active. I’m trying to open a new window/ tab to make this active but I have some difficulties and it doesn’t work yet. I cannot get the xpath of the settings’ button, so I came with this solution that works in a not automated chrome; searching for ‘Ask where to save each file before downloading’ and then hit Tab 3 times then press enter, but this doesn’t work in selenium.
This is the code I’m using:

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="" scriptlang="groovy">
		<robot name="webDriver" driver="chrome" close-on-completion="false" start-in-private="false">
				import groovy.json.*;
				import java.util.concurrent.TimeUnit;
				import org.apache.commons.lang.RandomStringUtils;
				import org.openqa.selenium.By;
				import selenium.webdriver.*;
				import org.openqa.selenium.WebDriver;
				//import org.openqa.selenium.Keys;
				def browserDriver =  webDriver.getWrappedObject();
				def waitobj  = new WebDriverWait(browserDriver, 1000);
				timeouts().implicitlyWait(10, TimeUnit.SECONDS);
				timeouts().implicitlyWait(10, TimeUnit.SECONDS);
				sendKeys('Ask where to save each file before downloading');
    <export include-original-data="true"></export>


Hi @ssoleimani,

Here is the sample your same script with some delay is doing the trick and i tried its working.

script.txt (1.3 KB)

Please let me know if it works.

Thanks for your response :slight_smile:

1 Like

Hi @aravindhan_mr,

Awesome! Thank YOU so much, yes your tricks worked well!

Now when I press the download button, the Save As dialogue box shows up. The only problem is I don’t know where to address to save the file in Control Tower that I could be able to retrieve it later. And why the dialogue box doesn’t do anything after I enter an address for saving the file; I tested in WorkFusion Studio like below, it just shows the dialogue box and remains there:
.// chrome settings to ask where download the file

pressEnter(); // shows the ‘Save As’ dialogue box
def path = “C:/_temp/”;
timeouts().implicitlyWait(10, TimeUnit.SECONDS);

Thanks again for your help.

1 Like

Hi @ssoleimani,

You are most Welcome :slight_smile: