randomaction - qlik-oss/gopherciser GitHub Wiki
Randomly select other actions to perform. This meta-action can be used as a starting point for your testing efforts, to simplify script authoring or to add background load.
randomaction accepts a list of action types between which to randomize. An execution of randomaction executes one or more of the listed actions (as determined by the iterations parameter), randomly chosen by a weighted probability. If nothing else is specified, each action has a default random mode that is used. An override is done by specifying one or more parameters of the original action.
Each action executed by randomaction is followed by a customizable thinktime.
Note: The recommended way to use this action is to prepend it with an openapp and a changesheet action as this ensures that a sheet is always in context.
-
actions: List of actions from which to randomly pick an action to execute. Each item has a number of possible parameters.-
type: Type of action-
thinktime: See thethinktimeaction. -
sheetobjectselection: Make random selections within objects visible on the current sheet. See theselectaction. -
changesheet: See thechangesheetaction. -
clearall: See theclearallaction.
-
-
weight: The probabilistic weight of the action, specified as an integer. This number is proportional to the likelihood of the specified action, and is used as a weight in a uniform random selection. -
overrides: (optional) Static overrides to the action. The overrides can include any or all of the settings from the original action, as determined by thetypefield. If nothing is specified, the default values are used.
-
-
thinktimesettings: Settings for thethinktimeaction, which is automatically inserted after every randomized action.-
type: Type of think time-
static: Static think time, defined bydelay. -
uniform: Random think time with uniform distribution, defined bymeananddev.
-
-
delay: Delay (seconds), used with typestatic. -
mean: Mean (seconds), used with typeuniform. -
dev: Deviation (seconds) frommeanvalue, used with typeuniform.
-
-
iterations: Number of random actions to perform.
The following default values are used for the different actions:
-
thinktime: Mirrors the configuration ofthinktimesettings -
sheetobjectselection:
{
"settings":
{
"id": <UNIFORMLY RANDOMIZED>,
"type": "RandomFromAll",
"min": 1,
"max": 2,
"accept": true
}
}-
changesheet:
{
"settings":
{
"id": <UNIFORMLY RANDOMIZED>
}
}-
clearall:
{
"settings":
{
}
}{
"action": "RandomAction",
"settings": {
"iterations": 5,
"actions": [
{
"type": "thinktime",
"weight": 1
},
{
"type": "sheetobjectselection",
"weight": 3
},
{
"type": "changesheet",
"weight": 5
},
{
"type": "clearall",
"weight": 1
}
],
"thinktimesettings": {
"type": "uniform",
"mean": 10,
"dev": 5
}
}
}{
"action": "RandomAction",
"settings": {
"iterations": 1,
"actions": [
{
"type": "sheetobjectselection",
"weight": 1,
"overrides": {
"type": "RandomFromExcluded",
"min": 1,
"max": 5
}
}
],
"thinktimesettings": {
"type": "static",
"delay": 1
}
}
}