Ask a Question

Setting the Default download directory for Keyword tests.

ppfeifer
Contributor

Setting the Default download directory for Keyword tests.

I have an application that creates a report in csv format.    I need to save that file in a particular directory.  My Browser sertings defaut drive is "Download" . I need this to go to a shared google drive instead of the C; Drive.  How can I set the default download directory during my keyword test to use a different directory just for this one test?

10 REPLIES 10
tristaanogre
Esteemed Contributor

You probably don't need to.  Here's what we do for something similar

 

  1. Use the "Sys.Username" property to grab the username of the user currently logged in
  2. Get that user's "Download" directory (C:\Users\<username>\Downloads) and find the file downloade
  3. Use aqFileSystem object to copy the file from that directory to your desired destination.

That's ultimately easier than messing around with changing Chrome settings or manipulating download dialogs.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

We are trying to automate so the download needs to be directed to the Shared Google drive for this test.  The file will be created once a month.  Is there a way to  change Chrome settings or manipulating download dialogs during the test and then resetting back?

tristaanogre
Esteemed Contributor

My suggestion was an automation suggestion.  You would write code to do so.  Let Chrome download to the default folder and then, after the download, write code to move the file as indicated.  My guess is that you're not automating/testing the ability of Chrome to download to the Shared Google drive.  So, how the file gets to the shared google drive is, most likely, immaterial to the test.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Currently you CANT set Chrome to download directly to google drive

But there is extensions that allows it:

https://chrome.google.com/webstore/detail/save-to-google-drive/gmbmikajjgmnabiglmofipeabaddhgne

 

The problem is that extension manipulation in Chrome is sometimes not easy.

But just try perhaps ?

 

 

 

Un sourire et ça repart

sonya_m
SmartBear Alumni (Retired)

Thank you for helping tristaanogre and BenoitB.

 

@ppfeifer any progress you would like to share with us? Did the suggetions help?


Sonya Mihaljova
Community and Education Specialist

I will give this a try. Thanks!

I will give this a try.   I will definitely use it for other instances.   The prblem I have is that it is code and I do not do much code.   I rely heavily on recorded keyword tests.   (Although I have been using a lot of the TestComplete precoded scripts and getting them to work with my tests).

tristaanogre
Esteemed Contributor

You can do all that I suggested in keyword tests.  There is an operation "Call object method" that allows you to use objects like aqFileSystem.  You can use the Set Variable operation and, in the value part, set to Code expression and call the System.Username value in the expression.

 

One thing to note... Keyword tests ARE code... just visualized code.  You're doing basically all the same stuff, just with drag and drop capabilities.  Regardless, I've found that, as good as Keyword Tests are, there are always things you can do better, more easily, and more elegantly with a little bit of code.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
sonya_m
SmartBear Alumni (Retired)

@ppfeifer were you able to solve this? Please mark the best answer here as a solution if you did.

 

Also, we are happy to hear about your progress and see what else we can suggest!


Sonya Mihaljova
Community and Education Specialist

cancel
Showing results for 
Search instead for 
Did you mean: