Automate right click save as in IE, Chrome and Firefox? - browser

Does anybody know a way I can automate the right click and save as actions for IE, Chrome and Firefox?
I am doing some selenium work using Maven and need to be able to download some files but I am unable to do this as the save as windows cannot (to my knowledge) be automated by Selenium as they are OS dialogs.

I disagree with Bob, Bill and the author of the article that is linked to in the other answer.
Downloads can be automated. The downloaded file can be meaningfully verified. In simplest case you can compare the contents of downloaded file with an existing exemplary file.
(Disclaimer: the next paragraph is about a tool which I am affiliated with).
For example if you use RIATest for automation you can automate the right click, then automate the OS dialog, then wait until the download is finished and verify the content of the downloaded file.

Related

Chrome extension select folder for several downloads

I'm working on a chrome extension that scrapes pages and downloads images within the page. However, I've run into a sort of roadblock.
Since the extension is designed to download several files at once, I'd like for the user to be able to click the 'Download' button, select a folder, then download all the images to that folder.
So far, the only thing I've seen that might be of use is the saveAs option in chrome.downloads.download(). However, it would be very tedious for the user to have to select a location and confirm for every file. Is there a way I can have the user select a folder, then just download all the files to that specific folder?
Let me know if I need to include any specific code. Figured it wasn't very important, since I don't even have code pertaining to this question currently.
Unfortunately you cannot. Your options are
Ask the user each time
Save the files to the downloads folder set by the user or a sub folder
Although much more complicated you could use native messaging and have native code communicate with the extension. You could then wait for the extension to complete the download and then send a message to your native host with the full path. Then your native host can move the file to where you want.

How to automate in-browser actions

very out of my element here but trying to find a solution. Currently, I am stuck with only one option to get a CSV file of some data, and that is by clicking on an EXPORT button from the Web UI of a webapp my company uses.
This really puts a kink in the works for automating and programatically setting everything up. How can I devise a script or maybe a plugin or something that can automatically do this action for me (clicking the export button) and be able to also schedule the action. Any ideas?
You can try to use AutoHotKey. It's a tool to automate UI in general.
Or you could try Selenium + Geckodriver. It is in browser automation, but I don't know if Export is supported.

Browser Detection Download

looking for some help with a rather unique or interesting issue. I am currently in the process of creating a website and would like to implement the following.
I have a download button where the end user can click download - Easy enough.
The complicated part is achieving the following
I would like to provide (automatically) the correct file for the user based on their operating system, so if the user is using windows and clicks the download button the windows file will be downloaded, and the opposite applies for mac.
any help is appreciated.

Node-Webkit file download progress

I have the following link in my Node-Webkit app
<a id="updateAppVersion" href="http://<some_path>/newVersion.zip">New version available</a>
This link works fine, it displays the 'save as' dialog and the user can save the file normally.
My question is, is there an easy way to display the download progress inside the app like browsers do or i need to create my own? (if so how?).
Currently nothing is displayed when the user chooses the download location.
I don't think that nwjs includes this feature. If you choose to write your own mechanism, try request-progress:
Tracks the download progress of a request made with mikeal/request,
giving insight of various metrics including progress percent, download
speed and time remaining
check this answer for more options.

User script installation

Is it possible to make it so I can put the user script that I made on my website and users to instal it simply by clicking on it (on firefox and chrome)?
And if it is possible how do I do it?
And how do I put my user script in chrome manually? In firefox it is simple, I just click on greasemonkey icon and select "new user script". But I simply can't figure out how to do it in chrome and couldn't find the answer online.
For me this looks like a really simple thing to do, but from some reason I can't find the answer by googling. Am I using a bad key word or something? idk.
Is it possible to make it so I can put the user script that I made on
my website and users to instal it simply by clicking on it (on firefox
and chrome)? And if it is possible how do I do it?
Yes. Just insert an ordinary download link such as
Click here to download my script!.
Please note prospective users should have Greasemonkey (Firefox) or Tampermonkey (Chrome) installed. Also, filename of the script should end with .user.js.
Example
And how do I put my user script in chrome manually? In firefox it is
simple, I just click on greasemonkey icon and select "new user
script". But I simply can't figure out how to do it in chrome and
couldn't find the answer online.
Use Tampermonkey.

Resources