Often in the course of testing a complex system, there is a need to move files about. SmarteScript has a built-in command called File Move, which allows you to easily move files around in the Windows system.
A secret to automation is to replicate the actions that you would normally take in the simplest form–don’t worry about bells and whistles, just get the job done. In this case, there’s no need to test an FTP client just to move files. Using simple dos commands allows you to easily accomplish complex tasks and call them from within a script.
For this exercise you will need to create a test file that you will save as a .bat file in a known location. The structure of this batch file is governed by the specification of FTP as implemented in windows (additional information can be found at http://support.microsoft.com/kb/96269). For example:
———————–
open xxx.xxx.xxxx.xxxx
USERNAME
PASSWORD
lcd c:\
cd DIRECTORYNAME
get FILENAME
bye
——————–
To call this batch file you would use the SmarteScript command Shell(DOS.”ftp -s:c:\\ftp.txt”). The -s specifies a script that will be run and this is your batch file. We would suggest playing with your batch file manually to insure it works well, every time, before including it in your automated test.
Example: FTP a file to the server
* Log onto the FTP server (see above)
* cd <pathname> – use this to CD to a directory on the remote computer
* lcd <pathname> – use this to CD to a directory on your local computer.
* bin – Turns on binary transfer.
* hash – Turns on progress.
* put <filename> – This will FTP the file.
* debug – toggle debugging mode.
On a side note, this functionality opens up the world of batch files for any DOS based feature to automated testing.
Good luck and Happy Testing.
SQA Technical Seminar Topics
Thursday, June 25th, 2009We are in the process of deploying technical seminars in various cities in the U.S. We want to make sure we choose the right topics, as well as, where to deploy.
Currently we are thinking about the following topics:
Please let us know in your comments which seminar you think is best and what city to have it in. Also, what additional topics would you liked covered.
Tags: SmarteSoft Seminars
Posted in General Comment | No Comments »