11.03 - Commands

'execute' 'script.html.selenium'

What : This command executes HTML format Selenium Suites. ("selenese" format)

EXECUTE execute WITH {seleneseTest<Res:script.html.selenium>} ON {webSUT<Tar:http>} USING {conf<Res:file>} AS {result<Res:result.selenium>}

Input:
  • seleneseTest<Res:script.html.selenium>: The name (in the context) of the resource which references the selenium test to execute. (Resource of category script.html.selenium)
  • webSUT<Tar:http>: The name in (the context) of the target corresponding to the SUT (Target of category http)
  • conf<Res:file>: (Optional) The name of the resource which references a configuration file which can contain two keys separated with comma:
 It can be define via an inline instruction. The format is <key>:<value>.

Note: The command needs the two keys (mainpath and browser). The command can retrieve them via the USING clause of the instruction or via the resource of type 'script.html.selenium' (See the 'From file to script.html.selenium' converter). Those two configuration keys are optional in each instruction (command and conversion) but each one must be defined in at least one instruction. If a key is defined in the convert instruction and in the command instruction, the key in the command instruction prime.

Output:

  • result<Res:result.selenium>: The result of the test execution. (Resource of category result.selenium)

Example:

EXECUTE execute WITH seleneseTest ON TargetWeb USING conf-file AS result



'execute' 'script.java.selenium1'

What: This command executes selenium 1 tests referenced as script.java.selenium1 resources.

EXECUTE execute WITH {selenium1Tests<Res:script.java.selenium1>} USING {conf<Res:file>} AS {result<Res:result.selenium>}

Input:
  • {selenium1Tests<Res:script.java.selenium1>}: The name (in the context) of the resource which references the java bundle containing the tests to execute. (Resource of category script.java.selenium1)
  • conf<Res:file>:(Optional) The name of the resource which references a configuration file which can contain only one key:
    • mainclass:The qualified name of the main java class. The configuration must be supplied as a text file with one line containing the qualified name. If you give more, the last read line becomes the main class name. It can be defined via an inline instruction.The format is <key>:<value>.
Note: The command needs this key. The command can retrieve it via the USING clause of the instruction or via the resource of type 'script.java.selenium1' (See the 'From script.java to script.java.selenium1' converter). This configuration key is optional in each instruction (command and conversion) but it must be defined in at least one instruction. If the key is defined in the convert instruction and in the command instruction, the key in the command instruction prime.

Output:

  • result<Res:result.selenium>: The result of the test execution. (Resource of category result.selenium)

Example:

LOAD selenium AS seleniumTestSource
CONVERT seleniumTestSource TO script.java (compile) AS seleniumTestCompiled
CONVERT seleniumTestCompiled TO script.java.selenium1 (script) USING $(org.squashtest.Selenium1JUnit4) AS seleniumTest

EXECUTE
execute WITH seleniumTest AS seleniumResult



'execute' 'script.java.selenium2'

What: This command executes selenium 2 tests referenced as script.java.selenium2 resources.

EXECUTE execute WITH {selenium2Tests<Res:script.java.selenium2>} USING {conf<Res:file>} AS {result<Res:result.selenium>}

Input:
  • {selenium2Tests<Res:script.java.selenium2>}: The name (in the context) of the resource which references the java bundle containing the tests to execute. (Resource of category script.java.selenium2)
  • conf<Res:file>:(Optional) The name of the resource which references a configuration file which can contain only one key:
    • mainclass:The qualified name of the main java class. The configuration must be supplied as a text file with one line containing the qualified name. If you give more, the last read line becomes the main class name. It can be defined via an inline instruction.The format is <key>:<value>.
Note: The command needs this key. The command can retrieve it via the USING clause of the instruction or via the resource of type 'script.java.selenium2' (See the 'From script.java to script.java.selenium1' converter). This configuration key is optional in each instruction (command and conversion) but it must be defined in at least one instruction. If the key is defined in the convert instruction and in the command instruction, the key in the command instruction prime.

Output:

  • result<Res:result.selenium>: The result of the test execution. (Resource of category result.selenium)

Example:

LOAD selenium AS seleniumTestSource
CONVERT seleniumTestSource TO script.java (compile) AS seleniumTestCompiled
CONVERT seleniumTestCompiled TO script.java.selenium2 (script) USING $(org.squashtest.Selenium2JUnit4) AS seleniumTest

EXECUTE
execute WITH seleniumTest AS seleniumResult



'launch' 'configuration.selenium'

What: To execute a selenium1 test at java format a selenium server can be started. This command launches a Selenium Server instance (formerly SeleniumRC server) following the configuration described by a configuration.selenium resource. This command produces a resource of type process for use with the cleanup command to kill it.
EXECUTE launch WITH {seleniumServerConfig<Res:configuration.selenium>} AS {seleniumServerProcess<Res:process>}

Input:
  • {seleniumServerConfig<Res:configuration.selenium>}: The name (in the context) of the resource which references a configuration file permitting to start a Selenium server.(Resource of category 'configuration.selenium)

Output:

  • {seleniumServerProcess<Res:process>}: The name (in the context) of the resource which references a processus linked to the Selenium Server. (Resource of category 'process')

Example:

LOAD selenium/selenium-rc-conf.properties AS selenium-rc-conf.file
CONVERT selenium-rc-conf.file TO configuration.selenium AS selenium-rc-conf
EXECUTE launch WITH selenium-rc-conf AS seleniumServer