SAHI Plugin - 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>} |
> Input :
{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 (script.sahi
type resource)
{sahiConf<Res:file>}
: The name of the sahi configuration file (file
type resource). The instruction supports to receive directly afile
type resource 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 version 1.7.0 - optional) : The time, in milliseconds, Squash TF should wait before giving up the execution. Default value is set to 60 seconds (was 30s before version 1.7.2).
{mainPath<Res:file>}
(optional) : Thisfile
type resource is necessary to the instruction when thescript.sahi
type resource is a bundle. It can also be defined via an inline instruction. It contains only one key / value separated with the character ‘:’ and with ‘mainpath’ as the key. 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 (http
type target).
> Output :
{sahiResult<Res:result.sahi>}
: The name of the resource which contains the result of the sahi command execution (sahi.result
type resource).
Example :
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 script.sahi
type resource is a bundle, the instruction need the configuration key ‘mainpath’. It can be obtained via the USING clause or via a script.sahi
type resource. 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.