Download any file from HeadlessDownloader without worrying of any download dialogs in your browser

Download any file from HeadlessDownloader without worrying of any download dialogs in your browser

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

No alt text provided for this image

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.

Arjun Unniumbath

Test Automation specialist | exploring different aspects of software engineering

5 年

Do you having any npm equivalent packages ?

要查看或添加评论,请登录

Kushan Shalindra Amarasiri的更多文章

社区洞察

其他会员也浏览了