How do I make my scheduler start a Test Composition playing?

by Community Manager on 07-07-2011 10:32 AM - last edited on 07-18-2011 11:39 AM by Community Manager

Introduction

The "CloudTest Command-Line Client" (also known as "SCommand") is a command-line utility that you can download and install on your computer. It allows you to perform the following operations from the Operating System command line on Windows, Unix, and Mac OS X systems:

  • Delete, import, or export SOASTA CloudTest items, such as Test Compositions, Test Clips, Scripts, Targets, and others.
  • Display lists of SOASTA CloudTest items.
  • Start Test Compositions and Playlists playing.
  • Display the status of various SOASTA services.

Use the SCommand built-in help system for a complete list of available commands.

Most Scheduling applications can execute Operating System commands, scripts, or "batch files". Therefore, if a copy of SCommand is accessible to your Scheduling application you should be able to schedule any of the operations that SCommand provides.

SCommand communicates with the SOASTA services through Web Service calls, thus the appropriate HTTP or HTTPS connection to those services must be available on the machine on which SCommand is to be run. No other connections are required.

 

Installing SCommand

Log in to SOASTA CloudTest, and go to the "Welcome" page.

Under "Download...", click "CloudTest Command-Line Client". When prompted, save the file "scommand.zip" somewhere on your disk.

Unzip the file, which will create a directory named "scommand".

Using SCommand

 

To run SCommand on Windows, use the following syntax:

 

C:\> scommand\bin\scommand.bat [parameters]

 

To run SCommand on Mac OS X or Unix, use the following syntax:

 

$ scommand/bin/scommand [parameters]

 

To use the SCommand built-in help system, use the "help" parameter (e.g. "scommand help"). You will see a list of supported sub-commands:

  • delete
  • drain
  • export
  • help
  • import
  • list
  • play
  • status

To see the built-in help for a given command, use the "help" parameter followed by the command name (e.g. "scommand help delete").

 

SCommand is invoked by specifying the command type using the "cmd" parameter. A common mistake is forgetting to put "cmd=" before the command type. E.g.:

 

Incorrect: scommand delete

Correct: scommand cmd=delete

 

The "url", "username", and "password" parameters are always required. They should be set to the SOASTA CloudTest URL, your SOASTA CloudTest user name, and your SOASTA CloudTest password. For example:

 

scommand url=http://myserver/concerto username=bob password=secret

 

Here is a complete example, which will delete the Test Composition named "/My Comp":

 

scommand cmd=delete url=http://myserver/concerto username=bob password=secret type=composition name="/My Comp"

 

Examples

 

Play the composition named "/Load Tests/Comp 1":

scommand cmd=play name="/Load Tests/Comp 1" username=bob password=secret url=http://mysbox/concerto

 

Play the playlist named "/Load Tests/Complete Set of Tests":

scommand cmd=play type=playlist name="/Load Tests/Complete Set of Tests" username=bob password=secret url=http://mysbox/concerto

 

Delete the composition named "/Load Tests/Comp 1":

scommand cmd=delete type=composition name="/Load Tests/Comp 1" username=bob password=secret url=http://mysbox/concerto

 

Export the composition named "/Load Tests/Comp 1" to a file called cmp1.xml:

scommand cmd=export type=composition name="/Load Tests/Comp 1" file=cmp1.xml username=bob password=secret url=http://mysbox/concerto

 

Import the file "myobjects.xml", skipping any objects that are already in the Repository:

scommand cmd=import file=myobjects.xml mode=skip username=bob password=secret url=http://mysbox/concerto

 

List all compositions in the Repository:

scommand cmd=list type=composition username=bob password=secret url=http://mysbox/concerto