Runscript Command Line Options

This page explains the different options you can use when you run Eggplant Functional scripts from a command line using the runscript command. This command runs scripts without launching the Eggplant Functional GUI.

To add multiple options, insert a space before each one. For more information about these commands, see Running from the Command Line. To invoke scripts using the Eggplant command, which launches the Eggplant Functional GUI, see Eggplant Command Line Options.

Important: For Mac installations of Eggplant Functional version 18.0 and later, the path to call the runscript command has changed to /Applications/Eggplant.app/Contents/MacOS/runscript. You might need to update tests created in earlier versions of Eggplant Functional to prevent errors. You also can click the Install runscript in /usr/bin/local button in Eggplant > Preferences > Run Preferences to add the runscript command to your user path. This allows runscript to be called from any directory via the command line.

If you're running Eggplant Functional on a Mac and using a version older than 18.0, the runscript command path is /Applications/Eggplant.app/runscript.

Note: We use the term arguments to describe the options you pass with the runscript or Eggplant command when you run those commands from the command line. Other terms you might be familiar with include options and flags.

We use the term parameters to refer to the values that you pass as input to scripts. See Passing Parameters for more information about passing parameters to scripts when you run them from a command line.

Connection Information

Specify the connection information for a Virtual Network Computing (VNC) or Remote Desktop Protocol (RDP) system under test (SUT) using the runscript command with the following flags:

  • -host: The hostname or IP address of a specific SUT to use for your scripts. When you pass a -host argument, you can also specify a color depth, password, port, and username.
  • -port: The port of the software you are using to connect to the SUT. This is the port of either the VNC server or RDP connections, you provide the username and password for the host Windows machine.
  • -username and -password: For VNC server connections to the SUT, you usually need to provide only the password. In rare cases, primarily when using UltraVNC, you might need the username. For RDP connections, you provide the username and password for the host Windows machine.
  • -password64 or -pass_code64: If you use Base64 encoding for passwords or passcodes that include standard and nonstandard characters, you can use either the -password64 or -pass_code64 option. Use the -password64 option to pass Base64 encoded passwords and the -pass_code64 option to pass Base64 encoded passcodes. For more information about encoding passwords or passcodes to Base64 format, see Base64 (Encode and Decode).
  • -colorDepth: The color depth of the SUT in the Viewer window: 8, 16, 32. (Default value: The native color depth of the SUT.)
  • -type [RDP, VNC]: The type of connection. RDP specifies an RDP connection and is available for Windows SUTs only. RDP connections use port 3389 by default. VNC specifies a VNC connection. The default connection type is VNC. Omitting the -type parameter results in a VNC connection.
  • -DefaultHeight and -DefaultWidth:These parameters specify to display the SUT screen, and the height and width in pixels at which it displays. These options are for use with RDP connections only, which means only when the -type option is included and set to RDP.

Examples:

Mac

/Applications/Eggplant.app/Contents/MacOS/runscript /Users/Alex/Docs.suite/Scripts/myTests/test2.script -host SUT1 -port 5901 -username joeuser -password broncos -colorDepth 16

Windows

"C:\Program Files\Eggplant\runscript.bat" "C:\Users\Alex\Documents\MySuite.suite\Scripts\test2.script" -host SUT1 -password broncos -type vnc-DefaultHeight 200-DefaultWidth 200

Linux

runscript ~/Documents/appTests.suite/Scripts/test1.script -host SUT1 -port 5901 -username joeuser -password broncos -colorDepth 16
Note: A connect command from within a running script or connection information in a schedule overrides this connection. This connection remains open, but the new connection becomes the active connection.

WebDriver Connection Information

Specify the connection information for a WebDriver connection using the runscript command with the following flags:

  • -webBrowser: Opens a WebDriver connection to a specific browser. Required.
  • -webHost: The host for the WebDriver connection. Required unless -host has been specified.
  • -webPort: Defines the port to use when creating a WebDriver connection. If no port is specified, port 4444 is used. Optional.

Examples:

Mac

/Applications/Eggplant.app/Contents/MacOS/runscript /Users/Bob/Selenium.suite/Scripts/test1.script -webBrowser "Chrome" -webHost "10.211.55.4" -webPort "4445"

Windows

"C:\Program Files\Eggplant\runscript.bat" C:\Users\Bob\Documents\Selenium.suite\Scripts\test1.script" -webBrowser "Chrome" -webHost "10.211.55.4" -webPort "4445"

Linux

runscript ~/Documents/Selenium.suite/Scripts/test1.script -webBrowser "Chrome" -webHost "10.211.55.4" -webPort "4445"

Additional Arguments

You can use the runscript command to send passwords, control where logs are stored, pass parameters, and more.

-CommandLineOutput

Use: Controls whether script logs (the data shown in the log area of the Run window) are output.

Valid values: yes or no. To output script logs, set the -CommandLineOutput argument to yes. To turn off this output, set the -CommandLineOutput argument to no.

Examples:

Mac

/Applications/Eggplant.app/Contents/MacOS/runscript /Users/Alex/appTests.suite/Scripts/test3.script -CommandLineOutput no

Windows

"C:\Program Files\Eggplant\runscript.bat" "C:\Users\Alex\Documents\appTests.suite\Scripts\test2.script" -CommandLineOutput no

Linux

runscript ~/Documents/appTests.suite/Scripts/test1.script -CommandLineOutput no

You can also set the CommandLineOutput global property within a script. Global properties that are changed in a script always override initial settings.

Note: Output set to standard error (stderr) is always displayed. For finer control over the output while running from the command line, you can use this syntax in your script:

write "THIS IS SOME OUTPUT" to error

-DefaultDocumentDirectory

Use: Specifies the starting directory for relative file paths to suites, such as the paths of helper suites.

Examples:

Mac

/Applications/Eggplant.app/Contents/MacOS/runscript -DefaultDocumentDirectory ~/Documents/EggplantDocs

Windows

"C:\Program Files\Eggplant\runscript.bat" -DefaultDocumentDirectory "C:\Users\Elizabeth\Documents\eggPlantTests"

Linux

runscript ~/Documents/appTests.suite/Scripts/test1.script -DefaultDocumentDirectory ~/Documents
Note: This is the same as the Eggplant Functional General Preference for Default Suite Directory.

-GlobalResultsFolder

Use: Sets the name of the folder in which your script results are stored. The folder path can be absolute, or relative to the script's suite.

Examples:

Mac

/Applications/Eggplant.app/Contents/MacOS/runscript /Users/Alex/Docs.suite/Scripts/test2.script -GlobalResultsFolder ~/MyResults

Windows

"C:\Program Files\Eggplant\runscript.bat" "C:\Users\Alex\Documents\MySuite.suite\Scripts\smoketestMain.script" -GlobalResultsFolder "C:\Users\Alex\Documents\ExecutionResults\SmokeTest"

Linux

runscript ~/Documents/appTests.suite/Scripts/test1.script ~/Documents/appTests.suite/Scripts/test2.script -GlobalResultsFolder ~/MyResults
Note: Setting the GlobalResultsFolder is temporary and only applies to the current Eggplant Functional session. It will not affect already started scrips and their results. Also, you must set the GlobalResultsFolder before you run your script, because once a script has started to execute, its log location is fixed. When you set the GlobalResultsFolder, your results are no longer stored in the suite, so you can't view them in the Suite window.

-LicenseKey, -LicenseUser

Use: Adds a license key and user for use of Eggplant Functional.

Examples:

Mac

/Applications/Eggplant.app/Contents/MacOS/runscript -LicenseKey <license_key> -LicenseUser <user_name>

Windows

"C:\Program Files\Eggplant\runscript.bat" -LicenseKey <license_key> -LicenseUser <user_name>

Linux

runscript -LicenseKey <license_key> -LicenseUser <user_name>

-LicenserHost

Use: You use the -LicenserHost argument to specify the location of the Eggplant Functional license server. You enter the -LicenserHost argument, followed by the IP address or hostname for the machine where your license server is running. Even if you specify the licenser host on the Eggplant License Registry panel, you might need to include this argument to run scripts from the command line.

Examples:

Mac

/Applications/Eggplant.app/Contents/MacOS/runscript /Users/Alex/Docs.suite/Scripts/test2.script -LicenserHost 10.1.11.105

Windows

"C:\Program Files\Eggplant\runscript.bat" "C:\Users\Alex\Documents\MySuite.suite\Scripts\test2.script" -LicenserHost bkwinsPC

Linux

runscript ~/Documents/appTests.suite/Scripts/test1.script ~/Documents/appTests.suite/Scripts/test2.script -LicenserHost 10.1.11.163
Note: This argument is required in most environments for running from the command line for both Reprise License Manager (RLM) and Team License Server (TLS).

-LicenserPassword

Use: Use this flag if you've set up RLM to require a password.

Examples:

Mac

/Applications/Eggplant.app/Contents/MacOS/runscript /Users/Fred/Docs.suite/Scripts/bigtest.script -LicenserPassword password

Windows

"C:\Program Files\Eggplant\runscript.bat" "C:\Users\Fred\Documents\MySuite.suite\Scripts\bigtest.script" -LicenserPassword password

Linux

runscript ~/Documents/appTests.suite/Scripts/test1.script ~/Documents/appTests.suite/Scripts/bigtest.script -LicenserPassword password
Note: This argument is only required if you've configured Reprise License Manager (RLM) to require a password.

-param (-p)

Use: The -param argument passes a parameter to a script. You can use -param before or after the name of the script. Note that the -param string must precede each parameter in the script. The -p form is an abbreviation for the same argument. You can use them interchangeably.

Note: The -param argument (without an "s" on the end) is not the same as the older -params argument.

Examples:

Mac

/Applications/Eggplant.app/Contents/MacOS/runscript ~/Documents/appTests.suite/Scripts/test1.script -param "SUT1" -param "phonebook.txt"

Windows

"C:\Program Files\Eggplant\runscript.bat" "C:\Users\Alex\Documents\MyTests.suite\scripts\test1.script" -param "SUT1" -param "phonebook.txt"

Linux

runscript ~/Documents/appTests.suite/Scripts/test1.script -param "SUT1" -param "phonebook.txt"

-repeat

Use: Repeats the scripts you are running a specified number of times.

Examples:

Mac

/Applications/Eggplant.app/Contents/MacOS/runscript /Users/Alex/myTests.suite/Scripts/test1.script -repeat 4

Windows

"C:\Program Files\Eggplant\runscript.bat" "C:\Users\Alex\Documents\MyTests.suite\Scripts\test1.script" -repeat 4

Linux

runscript ~/Documents/appTests.suite/Scripts/test1.script -repeat 4

-ReportFailures

Use: Reports the number of failed scripts and suites back to the command line after script execution. Valid values: yes/no. Default value: yes. If you want Eggplant Functional to report the number of successful scripts and suites to the command line, set it to no.

Examples:

Mac

/Applications/Eggplant.app/Contents/MacOS/runscript /Users/Alex/Docs.suite/Scripts/test1.script -ReportFailures yes

Windows

"C:\Program Files\Eggplant\runscript.bat" C:\Users\Alex\Documents\MySuite.suite\Scripts\test1.script" -ReportFailures yes

Linux

runscript ~/Documents/appTests.suite/Scripts/test1.script -ReportFailures yes

 

This topic was last updated on February 27, 2019, at 03:30:20 PM.

Eggplant icon Eggplant.io | Documentation Home | User Forums | Support | Copyright © 2019 Eggplant