HP Service Test 11.20 – How to use Service Test’s 8 FTP activities

Automation Guild Online Conference Top ad

Service Test's FTP activities

HP's Service Test was created to test headless technologies. One of those technologies is File Transfer Protocol (FTP). Service Test's FTP activities allow us to perform the following 8 FTP operations:

  • FTP Download
  • FTP Upload
  • FTP Rename
  • FTP File Delete
  • FTP File Get Size
  • FTP Directory Delete
  • FTP Directory Create
  • FTP Directory Get Content

(Before trying the Service Test activities I had to setup a local FTP site.)

Install a local FTP server

In order to acquire rights to certain operations while creating this post, I decided to create a local FTP server, which I did by installing XAMPP. XAMPP is an easy-to-install Apache distribution that contains a FileZilla FTP Server. Also LifeHacker has a really good article on how to Build a Home FTP Server with FileZilla.

Setup FTP

Once FileZilla was installed I also did the following:

  • Started FileZilla from the XAMPP Control Panel Application:


  • Created a Folder on my local “C ” drive named myFTP, then added a text file named joeTest.txt and an xmen.xml file to it:


  • Created an empty folder named ftpTemp on the Root of my “C” drive, then started the FileZilla Server Interface.exe from the

xampp\FileZillaFTP directory:


  • Under the General options, I created a user named service Test without a password



  • Under Shared folders, I added myFTP folder with all rights selected for the serviceTest user



Cool!! I then had my FTP server setup — complete with an FTP folder with files and a user, as well as full rights to both. Now, it's time to check out our first FTP activity FTP Download …

FTP Download

Create a new test in service test and add an FTP Download activity to the main canvas area from the FTP folder under the Toolbox.

Next, set the following properties under the FTP Download Property Sheet:

URL path = ftp://127.0.0.1/joeTest.txt

User ID = serviceTest

Local file path = C:\ftpTemp

Overwrite = true

The empty ftpTemp folder we created earlier should now contain the joeText.txt file


FTP Upload

In service test add to the main canvas area a FTP Upload activity from the FTP folder under the Toolbox.

Under the FTP Upload Property Sheet set the following properties:

Directory URL path = ftp://127.0.0.1/

User ID = serviceTest

Local file path = C:\blogpost.txt (the name of your file)

Overwrite = true

Your myFTP folder should now contain the uploaded file


FTP Rename

In service test add to the main canvas area a FTP Rename activity from the FTP folder under the Toolbox.

Under the FTP Renemae Property Sheet set the following properties:

Directory URL path = ftp://127.0.0.1/joeTest.txt

User ID = serviceTest

New file name = joeRenameTest.txt

Your myFTP folder should now contain the renamed file


FTP Delete

Let's delete the file we added using the previous FTP Upload activity. In service test add to the main canvas area a FTP Upload activity from the FTP folder under the Toolbox.

Under the FTP Upload Property Sheet set the following properties:

Directory URL path = ftp://127.0.0.1/jblogPost.txt

User ID = serviceTest

Your myFTP folder should now contain only 2 files.

FTP File Get Size

In service test add to the main canvas area a FTP File Get Size activity from the FTP folder under the Toolbox.

Under the FTP File Get Size Property Sheet set the following properties:

Directory URL path = ftp://127.0.0.1/joeRenameTest.txt

User ID = serviceTest

Your test result's should contain the file info with the FileSize for the file:


FTP Directory Create

In service test add to the main canvas area a FTP Directory Create activity from the FTP folder under the Toolbox.

Under the FTP Directory Create Property Sheet set the following properties:

URL path = ftp://127.0.0.1/

User ID = serviceTest

Directory name = ftpCreateDir

Your myFTP folder should now contain the ftpCreateDir directory


FTP Directory Delete

Now let's delete the directory we just created. In service test add to the main canvas area a FTP Directory Delete activity from the FTP folder under the Toolbox.

Under the FTP Directory Delete Property Sheet set the following properties:

URL path = ftp://127.0.0.1/ ftpCreateDir

User ID = serviceTest

Your myFTP folder should now no longer contain the ftpCreateDir directory

FTP Directory Get Content

And now for the last FTP activity. In service test add to the main canvas area a FTP Directory Get Content activity from the FTP folder under the Toolbox.

Under the FTP Directory Get Content Property Sheet set the following properties:

URL path = ftp://127.0.0.1/

User ID = serviceTest

In the HP Reun Results Viewer navigate to the FTP Directory Get Content and clcik on the Captured Data Output link



1 comment
Israel Valencia - January 23, 2013

Awesome Joe!
A couple of questions… Does Service Test support SFTP? And, can QTP be used for SFTP connections?
Thank you

Reply
Click here to add a comment

Leave a comment: