Random clicking: links, buttons, checkboxes and file uploads

Clicks random elements matching its selector, or random positions on them.

Nothing to set up: it's on by default, so a plain elsetest --url staging.example.com already uses it. The options below are for fine-tuning.

This is Elsetest's Click plugin. It runs as 9 instances, each with an alias and options of its own (below). In each step of a test, one plugin instance is picked at random, weighted by its frequency.

Options

Set them for one instance with --plugin alias=<alias> key=value, or for every instance of the plugin with --plugin name=Click key=value. In a config file, each --plugin is an object in "plugins", e.g.:

{
  "plugins": [
    { "alias": "ClickLink", "frequency": "high" }
  ]
}

A selector says which elements of the page an option is about, e.g. #chat-widget or .cookie-banner button: see Selectors.

frequency

--plugin alias=CloseBanner frequency=<level>

How often the plugin runs compared to the others.

One of off, lowest, low, normal, high, highest. Default: normal. The default instances set their own (below).

selector

--plugin alias=CloseBanner selector=<selector>

The elements to click: a CSS selector, or XPath prefixed with "xpath:". ":root" is the whole page.

Default: *:not(a[href]):not(br).

position

--plugin alias=CloseBanner position=<position>

Where in an element to click: its center, or a random position in it (see scroll).

One of center, random. Default: center.

scroll

--plugin alias=CloseBanner scroll=true|false

Also act on elements outside the window, scrolling to them first. Otherwise only elements in the window are used, and the Scroll plugin moves the window. With position random, it also clicks anywhere in the element (with selector ":root", anywhere on the page), not just in the part of it in the window.

Default: false.

ignoreSelector

--plugin alias=CloseBanner ignoreSelector=<selector>

Elements this plugin doesn't act on, nor on anything inside them; replaces the global ignoreSelector (not the data-elsetest-ignore attribute, which always applies). The site can also mark the elements in its HTML with the attribute data-elsetest-click-ignore.

Default: the global ignoreSelector.

ignoreText

--plugin alias=CloseBanner ignoreText=<regex>

This plugin doesn't act on a control whose text or label matches this case-insensitive regular expression; replaces the global ignoreText.

Default: the global ignoreText.

Default instances

AliasThe options it sets
CloseBannerselector=xpath://button[contains(translate(., 'ACCEPT', 'accept'), 'accept') or contains(translate(., 'CONSENT', 'consent'), 'consent') or contains(translate(., 'YES', 'yes'), 'yes') or contains(translate(., 'AGREE', 'agree'), 'agree') or contains(translate(., 'DISMISS', 'dismiss'), 'dismiss')] frequency=low scroll=true
ClickLinkselector=a[href] frequency=normal
ClickAnywhereselector=:root position=random frequency=normal
MulticlickAnywhereselector=:root position=random frequency=low
ClickCheckboxselector=input[type=checkbox] frequency=normal
ClickRadioButtonselector=input[type=radio] frequency=normal
ClickButtonselector=button frequency=normal
ClickSubmitselector=input[type=submit], button[type=submit] frequency=normal
UploadFileselector=input[type=file] frequency=normal

Other plugins

Accessibility · Ai · BrokenText · Cluster · History · Login · MutationCluster · Overlap · Scroll · SelectOption · Spelling · Type · Validate

This page is generated from the help texts of Elsetest 0.9.8. The same help is in the program: elsetest --help.