Book Image

Advanced UFT 12 for Test Engineers Cookbook

Book Image

Advanced UFT 12 for Test Engineers Cookbook

Overview of this book

Table of Contents (18 chapters)
Advanced UFT 12 for Test Engineers Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Downloading a file using XMLHttp


This recipe will show you how to download a file using the XMLHttp object, which we have seen in action in the Checking whether page links are broken recipe. Here we will expand on a theme and see how to synchronize our script using the onreadystatechange event handler to report on the progress of our download. The code includes the required modifications, and is the same as the one I used in a project a few years ago.

Getting ready

From the File menu, navigate to New | Function Library or use the Alt + Shift + N shortcut. Name the new function library as Web_Download.vbs. To use the AutoItX COM object, go to https://www.autoitscript.com/site/autoit/downloads/ to download and install AutoIt. This is absolutely necessary in order to ensure that the code given here will work properly with regard to the notifications display.

How to do it...

This recipe will demonstrate how to download the last build JAR file from a remote build machine and deploy it to the local...