For my load testing, I have a need for my virtual users to connect to a FTP server and download some files. I did not see any FTP actions in Neoload. Is it something that can be done with Neoload?
During your load test, you may want your virtual user to connect to an FTP server to upload or download some files. This can be done through a Neoload javascript.
Here is an example of how to use FTP within a javascript using the FTPClient packages. All the available methods can be found here:Apache
// Initialisation
myFTPClient =new Packages.org.apache.commons.net.ftp.FTPClient(); myFTPClient.connect("servername"); myFTPClient.login("username","password"); logger.debug(myFTPClient.getReplyCode()+" "+myFTPClient.getReplyString());
//Command PWD
myFTPClient.printWorkingDirectory(); logger.debug(myFTPClient.getReplyCode()+" "+myFTPClient.getReplyString());
//Create a new folder with MKDIR command
myFTPClient.makeDirectory("FTPNeoload"); logger.debug(myFTPClient.getReplyCode()+" "+myFTPClient.getReplyString());
//Command LIST
engine =myFTPClient.initiateListParsing("/");
while (engine.hasNext())
{
file = engine.getNext(5);
logger.debug(file[0].getName());
}
//Use of the GET method
var writer = new java.io.FileOutputStream("c:\\Temp\\MyFile.zip",true);
myFTPClient.retrieveFile("MyFile.zip",writer);
writer.close();
logger.debug(myFTPClient.getReplyCode()+" "+myFTPClient.getReplyString());
//Use of the PUT method
var reader = new java.io.FileInputStream("c:\\Temp\\myfile.xps"); myFTPClient.storeFile("myfile.xps",reader);
reader.close();
logger.debug(myFTPClient.getReplyCode()+" "+myFTPClient.getReplyString());
myFTPClient.logout();
myFTPClient.disconnect();
For more information, see "NeoLoad Javascript API" in Neoload documentation.