10.03 - Command

'execute' 'script.sahi' on 'http'

What: This command will execute a sahi script againt an http SUT using a configuration file.
EXECUTE execute WITH {sahiScript<Res:script.sahi>} ON {server<Tar:http>} USING {sahiConf<Res:file>}, [{mainPath<Res:file>}] AS {sahiResult<Res:result.sahi>}
  • sahiScript<Res:script.sahi>: The name (in the context) which references either a sahi script or a bundle containing a test or a test suite to execute (Resources of category script.sahi)
  • sahiConf<Res:file>: The name of the sahi configuration file (Resource of category file). The instruction supports to receive directly a resource of category file instead of a converted resource in 'properties'. It's mandatory and can be defined via an inline instruction. The referenced file contains a list of key / value separated with the character '=' and one property per line. Possible keys are:
    • browserType (mandatory): name of the browser. It should reference the "name" of a browserType define in the file browser_types.xml of the sahi proxy. You can found this file in SAHI_PROXY_HOME/userdata/config (The proxy should have been launched at least one time in order to the file exist). It's also possible to retrieve the content of the file through a web browser by using the url : http://SAHI_HOST:SAHI_PORT/_s_/dyn/ConfigureUI_readFile?fileName=config/browser_types.xml
    • sahi.proxy.host (optional): Name of the machine where is the sahi proxy. Default value is localhost.
    • sahi.proxy.port (optional): Port used by the sahi proxy. Default value is 9999.
    • sahi.thread.nb (optional): Number of browser instance to launch in parallel. Default value is 1.
    • report.format (optional): Report type. Default value is html. The other possible value is junit.
    • timeout (since 1.7.0 - optional): The time, in milliseconds, Squash TA should wait before giving up the execution. Default value is set to 60 seconds (was 30s before Squash-TA framework 1.7.2).
  • mainPath<Res:file>:(Optional).This resource of category file is necessary to the instruction when the resource of category script.sahi is a bundle. It can be defined via an inline instruction. It contains only one value / key separated with the character ':'.: 'mainpath'. It corresponds to the path, relatively to the bundle root to the sahi file defining the sahi test suite.
  • server<Tar:http>: The name in (the context) of the target corresponding to the SUT (Target of category http)
  • sahiResult<Res:result.sahi>: The name of the resource which conatains the result of the sahi command execution (Resource of category sahi.result)


LOAD sahi-scripts/test.sah AS sahi-script.file
CONVERT sahi-script.file TO script.sahi (script) AS test.script

LOAD configuration/sahi-conf.properties AS conf

EXECUTE execute WITH test.script ON Connexion-gui USING conf AS result

Remark: In the case where the resource of category 'script.sahi' is a bundle, the instruction need the configuration key 'mainpath'. It can be obtained via the Using clause or via the resource of category 'script.sahi'. This configuration key is optional in both instructions but must be defined in one of them. If its defined in both, so the value indicated in the command instruction prime.