O'Reilly logo

Advanced UFT 12 for Test Engineers Cookbook by Jonathon Lee Wright, Meir Bar-Tal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Uploading a file using FTP

In a previous recipe, we have seen how to download a file using XMLHttp. Here we will see how to upload a file to a web server using the FTP protocol.

Getting ready

From the File menu, navigate to New | Function Library or use the Alt + Shift + N shortcut. Name the new function library FTP.vbs. Make sure the library is associated to the test. In order to use the code given in this recipe, you must have an FTP user account on a server. To understand this recipe, you should be familiar with FTP protocol and the command line.

How to do it...

In the function library, we will put the following code.

  1. First we will define the following constants for better readability and reusability:
    const C_FSO="Scripting.FileSystemObject" const ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required