Some script actions are very simple. Screenshot, for example, just requires a descriptive comment where you can describe what the screenshot should be.
Many other actions require a few other fields to set up. <selector> is the most important, but probably also the most tricky to write.
Any action that actually interacts with your website – e.g. clicking, hovering, entering text, filling out a form, opening and selecting a dropdown – will require a selector.
Selectors are a bit like an address. The script needs to know which “thing” to click/hover etc. So selectors are used to tell the script where and what element on your page to interact with.
Finding what to interact with is normally done by referencing an HTML element on the page. This is often referred to as a “target”; as in “To click on this link, we need to target the following button…”
This immediately causes some issues for non-technical users who want to work on User Journeys: it’s not immediately obvious how to find an element, and it can be intimidating looking at source code. It’s even tricky at times for experienced and technical users to write selectors that work well for a variety of reasons.
To make things easier, we’ve made it possible to “target” HTML elements using a variety of different methods.
These are:
We’ll explain each of these in the following lessons – however first we’ll have a quick overview of HTML elements themselves and how they are structured.