Download any file from HeadlessDownloader without worrying of any download dialogs in your browser
Kushan Shalindra Amarasiri
Director Quality Engineering at Social Catfish
We as test automation professionals face many challenges when automating test scenarios. One of these challenges is how I can perform any file download without the hazel of automating the download dialog which adds extra level of code to your script.
Headless downloader is a small utility library which I have developed for anyone which will download any file of any size without the worry of file dialog box automation. The headless downloader can be run on any healdess browser like chrome and firefox where in real scenario these browsers would not able to capture file dialog boxes when executed in headless mode.
To download the JAR file, please visit the following URL
Next add the jar file in your build path
Next import the class in your test scenario
import org.kushan.headlessdownload.*;
Add the following method in your script which specified the URL location of the source and the file destination location.
HeadlessDownloader.headles_download("https://file-examples.com/wp-content/uploads/2017/02/file-sample_500kB.doc", "test.doc");
}
Run the test case and file will be downloaded headless.
Test Automation specialist | exploring different aspects of software engineering
5 年Do you having any npm equivalent packages ?