Forum Discussion

Semirxbih's avatar
Semirxbih
Contributor
10 months ago

Unable to target download dialog window

Hey all,

So I am running into an issue where I am unable to target the "Downloads" dialog window on Microsoft Edge so I am seeking some help to see if anyone might be able to give me some guidance.

Here is the window that I am attempting to target:

So when I check my objectTree, I am able to see the following object:

Then I can see that I have an active Edge browser window:

So I have tried all of the following scenarios, here is the first scenario that I attempted:

    var downloadDialog = Aliases.browser.FindChildEx(
        ["ObjectType", "Caption"], 
        ["Dialog", "Downloads"],
        10,
        true,
        60000
    );

The above code returns an empty object, no response.

I also attempted to use the following code snippets:

var test = Aliases.browser.Dialog("Downloads").Pane(0);
var test1 = Aliases.browser.Dialog("Downloads");

Use the above snippets, I am also not able to properly target it.

Is there anyone that might be able to assist me with how to properly target an "Downloads" window?

    • Semirxbih's avatar
      Semirxbih
      Contributor

      I am not sure why it did that, this is the code that I provided for the first:

          var downloadDialog = Aliases.browser.FindChildEx(
              ["ObjectType", "Caption"], 
              ["Dialog", "Downloads"],
              10,
              true,
              60000
          );

      And this is the code that I provided for the second code block:

          var test = Aliases.browser.Dialog("Downloads").Pane(0);
          var test1 = Aliases.browser.Dialog("Downloads");

      • rraghvani's avatar
        rraghvani
        Champion Level 3

        Is it necessary to automate the Downloads dialog? Why not just configure your browser to automatically download the file to the specified folder?

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    In Chrome, I have the following

    The file is automatically downloaded in the location. 

    In my scripts, if the file already exists in the location, I delete it. I then download the file from the browser, check if the file exists and then perform the necessary checks.

    I'm not testing the browsers' download functionality, therefore no need to automate it.

  • eykxas's avatar
    eykxas
    Regular Contributor

    Hi !

    I have a similar thing in my project. I use UIAutomation to get these buttons.