Skip to content

FTP Testing Task

The FTP Testing Task defines an FTP protocol testing task for FTP functionality, performance, stability, and custom testing.

Main Parameter List

ParameterTypeRequiredLength LimitDescription
targetenumYes-Task Type
Fixed value: FTP
namestringYes≤400 charsTask Name
Unique identifier for FTP task
descriptionstringNo≤800 charsTask Description
Detailed explanation of task purpose
enabledbooleanYes-Enable Status
true: Enabled (default)
false: Disabled
beforeNamestringNo≤400 charsPredecessor Task
Controls task execution order
serverobjectYes-Server Configuration
See server configuration details below
uploadFilebooleanYes-Transfer Direction
true: Upload
false: Download (default)
uploadFileSourceenumNo-File Source
REMOTE_FILE: Remote file
REMOTE_URL: Remote URL
LOCAL_FILE: Local file (default)
remoteFileNamestringNo≤4096 charsRemote Filename
Upload: Save filename
Download: Download filename
remoteFileUrlstringNo≤4096 charsRemote File URL
Download file from this URL when uploading
localFileNamestringNo≤4096 charsLocal Filename
Upload: Local file path
Download: Local save path
localFileContentstringNo≤2MBLocal File Content
Supports Base64/Gzip encoding
localFileContentEncodingenumNo-Content Encoding
none: Plaintext
base64: Base64 encoding
gzip_base64: Gzip compressed then Base64
binaryModebooleanNo-Transfer Mode
true: Binary mode
false: Text mode

Note

Supports orchestrating multiple FTP interfaces simultaneously, but only one FTP test can be enabled at a time.

Complete FTP configuration example:

yaml
- target: FTP
  name: UploadFromLocalFile
  description: Upload file from local file
  enabled: true
  server:
    # FTP server configuration ...
  uploadFile: true
  uploadFileSource: LOCAL_FILE
  remoteFileName: remote.txt
  localFileName: local.txt
  localFileContent: This is a text file content
  localFileContentEncoding: none
  binaryMode: false

Server Configuration (server)

Field NameTypeRequiredLength/Range LimitDefaultDescription
serverstringYes≤253 chars-FTP Server Address
Supports IP or full domain
Example: ftp.example.com
portintegerYes1-6553521Service Port
Standard port: 21 (command port)
Data ports auto-assigned by mode
usernamestringConditional≤400 chars-Authentication Account
Required when server requires auth
Example: ftpuser
passwordstringConditional≤4096 chars-Authentication Credential
Encrypted storage and transmission
Enterprise use SFTP instead
readTimeoutstringNo1s-24h60sData Transfer Timeout
Format: number+unit (e.g., 30s)
Large files recommend 300s
connectTimeoutstringNo1s-24h6sConnection Timeout
Format: number+unit (e.g., 10s)
Cross-region recommend 15-30s

FTP server configuration example:

yaml
server:
  server: localhost
  port: 8084
  username: admin
  password: 123456
  readTimeout: 60s
  connectTimeout: 6s

File Transfer Direction (uploadFile)

  • Upload (true): Transfer file from local to FTP server
  • Download (false): Get file from FTP server to local

File Source (uploadFileSource)

SourceUse CaseRelated Parameters
LOCAL_FILEUse local filelocalFileName
localFileContent
REMOTE_FILEUse FTP server fileremoteFileName
REMOTE_URLGet file from URLremoteFileUrl

Transfer Mode (binaryMode)

ModeFile TypesCharacteristics
Binary ModeImages/Videos/Compressed filesPreserves file integrity
Text ModeText filesAuto-converts line endings

Script Examples (target)

Complete Parameter Configuration Example

yaml
- target: FTP
  name: UploadFromLocalFile
  description: Upload file from local file
  enabled: true
  server:
    server: localhost
    port: 8084
    username: admin
    password: 123456
    readTimeout: 60s
    connectTimeout: 6s
  uploadFile: true
  uploadFileSource: LOCAL_FILE
  remoteFileName: remote.txt
  localFileName: local.txt
  localFileContent: This is a text file content
  localFileContentEncoding: none
  binaryMode: false

Download File from Server for Upload Example

yaml
- target: FTP
  name: UploadFromRemoteFtpFile
  description: Download a file from the Ftp server and then upload it
  server:
    server: localhost
    port: 8084
    username: admin
    password: 123456
  uploadFile: true
  uploadFileSource: REMOTE_FILE
  remoteFileName: remote.txt

Download File from Remote URL for Upload Example

yaml
- target: FTP
  name: UploadFromRemoteUrl
  description: Download a file from the Ftp server and then upload it
  server:
    server: localhost
    port: 8084
    username: admin
    password: 123456
  uploadFile: true
  uploadFileSource: REMOTE_URL
  remoteFileUrl: https://pics6.baidu.com/feed/d50735fae6cd7b897fbfd8ad27e746a9d8330e1a.jpeg

Upload Local File Example

yaml
- target: FTP
  name: UploadFromLocalFile
  description: Upload file from local file
  server:
    server: localhost
    port: 8084
    username: admin
    password: 123456
  uploadFile: true
  uploadFileSource: LOCAL_FILE
  remoteFileName: remote.txt
  localFileName: local.txt
  localFileContent: This is a text file content

Upload Local File with Base64 Encoding Example

yaml
- target: FTP
  name: UploadAndEncodingFromLocalFile
  description: Upload and encode file from local file
  server:
    server: localhost
    port: 8084
    username: admin
    password: 123456
  uploadFile: true
  uploadFileSource: LOCAL_FILE
  remoteFileName: remote.txt
  localFileName: local.txt
  localFileContent: VGhpcyBpcyBhIHRleHQgZmlsZSBjb250ZW50
  localFileContentEncoding: base64
  binaryMode: false

Download File Example

yaml
- target: FTP
  name: RetrieveFile
  description: Retrieve file from remote Ftp server
  server:
    server: localhost
    port: 8084
    username: admin
    password: 123456
  uploadFile: true
  remoteFileName: test.txt

Download and Rename File Example

yaml
- target: FTP
  name: RetrieveAndRenameFile
  description: "Retrieve file from remote Ftp server and save it. Note: By default,\
    \ it is saved in the execution data directory."
  server:
    server: localhost
    port: 8084
    username: admin
    password: 123456
  uploadFile: true
  remoteFileName: remote.txt
  localFileName: new_file.txt

Released under the GPL-3.0 License.