Having trouble getting an ftp protocol script in LoadRunner to work
Question ID: 104086
0
0

Having trouble getting an ftp protocol script in LoadRunner to work. I do a ftp_get_ex() in the script, but the file never gets downloaded. It seems to connect to the ftp server ok in the log, and it says the get is successful, but still no file gets downloaded. has anyone seen this happen before. See my code snipet below: Action() { char * host = "ftp.myFTPHost.com"; char * user = "myUSERname"; char * pwd = "myPASSword"; char * port = "21"; char ftpURL[100]; double duration; FTP pFtp; sprintf(ftpURL, "URL=ftp://%s:%s@%s:%s", user, pwd, host, port); lr_output_message ("%s", ftpURL); ftp_logon_ex(&pFtp,"FtpLogon",ftpURL,LAST ); ftp_get_ex (&pFtp,"GET_TRANSACTION", "SOURCE_PATH=/TESTLRFTP/101.xml","TARGET_PATH=c:/Downloads/101.xml", "MODE=ACSII",LAST); duration= ftp_get_last_transfer_duration_ex(&pFtp); lr_output_message ("Get_Small_File Transfer took %.3f milliseconds", duration); ftp_logout_ex(&pFtp); return 0; }

Marked as spam
Posted by (Questions: 36, Answers: 3)
Asked on April 8, 2010 1:02 pm
174 views
Answers (1)
4
Private answer

The problem is in the ftp_get_ex() arguments. The example in the LoadRunner documentation is missing this, so it is easy to understand why you missed it. If you read the function definition for ftp_get_ex() function options for the third parameter, you will see that the option list needs to end with ENDITEM with no quotes. If you put that in, then your script should work. See my example below:

  ftp_get_ex (&pFtp,''GET_TRANSACTION'', ''SOURCE_PATH=/TESTLRFTP/101.xml'',''TARGET_PATH=c:/Downloads/101.xml'', ''MODE=ACSII'',ENDITEM,LAST);
Marked as spam
Posted by (Questions: 6, Answers: 167)
Answered on April 8, 2010 1:06 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top