Interesting enough, I had a choice which automation tool to use and I choose KSE. If it’s impossible to use KSE for such a simple task as file downloading then I should’ve chosen UFT.
Please clone this sample project and change the “download.default_directory” to your desired folder and run a sample test case: GitHub - duyluonganh/kat-download-file
When I put just browser.download.manager.showWhenStartingbrowser, it still works. Does it mean that this preference is not really needed?
Also, could you please let us know when did you get the info on which capabilities should be used and what those capabilities mean? I’ve spent a lot of time trying to find the right capabilities but whatever I found wasn’t working.
And last but not least, do you happen to know whether it’s possible to download a pdf file (the only pdf file on the page) w/o clicking on it? Thanks again!
I also updated my repo with the Firefox desired capabilities. You can pull the code and run the sample test.
Also, could you please let us know when did you get the info on which capabilities should be used and what those capabilities mean? I’ve spent a lot of time trying to find the right capabilities but whatever I found wasn’t working.
Chrome and Firefox provide their desired capabilities at their website, you should read these documents first:
Next step, you need to search in the Selenium communities about this issue and realize the problem here. Eg:
When clicking on a normal file (not pdf), Chrome and Firefox will ask to download the file. You need to find the desired capability to tell the browser don’t ask about to download.
When clicking on a pdf file, Chrome and Firefox will display the file using the pdf viewer. You need to find the desired capability to tell the browser to treat the pdf as a normal file.
During the test, you should open Chrome settings and Firefox about:config to check that all desired capabilities have been recognised by the browser.
@duyluong, thanks a lot for your help, the updated repo and detailed reply!
It does work when I use these capabilities in Desired Capabilities → Web UI → Firefox (as it’s shown in your screenshots).
However, when I try to use the very same capabilities in Desired Capabilities → Custom, it doesn’t seem to be working because the Windows dialog appears :
Download Katalon Studio by signing up for a free account at Katalon’s website. After installation, login to the Katalon Studio using your account credentials and create a new Sample Android Mobile Tests Project. The process has been detailed for the sample app and test cases provided by Katalon, you can replace the app with your own app and make changes in your test cases accordingly.
sample_project
Set the project name in the ‘Name’ field and click OK
name
In the Tests Explorer window go to the folder androidapp → APIDemos.apk. This is the application which will be tested on BrowserStack.
test_explorer
Upload app on the BrowserStack server
Upload APIDemos.apk to BrowserStack using your account credentials (Username and Access Key). The REST API is: