User Tools

Site Tools


wiki:pickle:sautomconfig

How to configure a scripts executions parameters

Each script can have an accompanying config file (.json) that pre-defines the configuration applied to an execution script. The filename of that config is identical to the script but has a “.json” extension.

For example:

if my script were called “myScript.feature”, the config file would be called “myScript.json”.

Why?

All options can be configured in the file or can be set during the manual execution of a single script (see the screen below).

There are three main reasons for creating script configuration files:

  • Setting the default automation Browser and behaviours for the execution of the script
  • Disabling the ability for the tests executor to change that config.
  • Test plan steps (scripts) cannot be configured during execution, so need to be configured in advance.

Can I create a Single config file for all my scripts?

[New in 1.12.0.2]

It is possible to create a config file that applies to a whole folder of scripts. To do this you create a config file called “feature.json” in your script folder. This will then be the default configuration for all scripts in the folder.

Important: If you create a specific config file for a script, it will automatically override this default config.

Creating a Config File

There are two ways to create a config file. To ensure the latest version, it is advised that you use the “New” function in Pickle.

Manual

Copy the following JSON code into a file you have created manually.

{
  "SeleniumWaitTimoutSeconds": 20,
  "SeleniumCustomDriverName": "",
  "FailQuietly": true,
  "StopOnFail": true,
  "AllowEditConfigInUI": true,
  "BypassIFrameSecurity": false,
  "forceScriptLoad": false,
  "debug": false,
  "maximiseBrowser": true,
  "SeleniumDriverName": "chrome"
}

Pickle

Crate the template using the new file wizard:

  1. In Pickle, select the “File” menu.
  2. Select “New..” (CTRL+N)
  3. In the new file dialogue select “Script Driver Configuration” item in the “JSON Data File” section.

  1. Click Create.
  2. A template JSON File will be created.

Configuration Parameters

Selenium Timeout

{
  "SeleniumWaitTimoutSeconds": 0
}

Defines (in seconds) how long selenium will wait before a command fails.

Selenium Driver

{
  "SeleniumDriverName": "",
}

Defines the driver name to use when executing a web automation script. Supported Values:

  • chrome
  • ie
  • edge
  • firefox
  • Custom (See custom selenium driver)

Custom Selenium Driver

{
  "SeleniumCustomDriverName": ""
}

If the driver name is set to “custom” this parameter allows you to define which custom drive to use. :!: Custom Drivers are not currently supported. This is provided for future compatibility.

Fail Quietly

{
  "FailQuietly": true
}

Defines if the automated test fails without providing the standard failure dialogue options (Stop Test or Continue).

Stop On Failure

{
  "StopOnFail": false
}

if the script “fails quietly” this determines if the script stops on failure or continues to try to execute later steps.

Disable User Configuration

{
  "AllowEditConfigInUI": true
}

if set to false, the user will not be able to change the configuration when executing. They could still edit the JSON file.

Bypass Cross-Domain Scripting Protection

{
  "BypassIFrameSecurity":true
}

if true and the driver is Chrome, security controls will be disabled and scripting will work across Iframe form separate origins.

Force Java Script Load

The autoload feature is fragile because modern web applications don't require the script to navigate to new pages but rather either navigate themselves of dynamically load the data into a current page. PIckle provides a method for resolving this. If you provide the following configuration in the scripts JSON file, Pickle TS will check on each web command that the script is loaded. The cost is latency (slower scripts)because it has to fun JavaScript command to verify.

{
"forceScriptLoad": true
}

It can also be enabled on the config screen:

Debug

{
  "debug":true
}

if true the script will be executed in debug mode. The main reason for this configuration is to show protected variables during execution.

Maximise Browser

{
  "maximiseBrowser":true
}

if true the pickle will attempt to maximise the browser window when launched.

/kunden/homepages/16/d819147553/htdocs/thinkingengine/wiki/data/pages/wiki/pickle/sautomconfig.txt · Last modified: 01/03/2020 00:24 (external edit)