How to automate multiple button clicks
Learn more about automating multiple clicks within your Axiom.ai automation. There are multiple methods of performing these actions.
# The Click multiple elements step
To automate multiple button clicks, use the Step Finder to add the Click multiple elements step. This would allow for buttons to be clicked within a list.
- Click "Select" to open the Selector Tool to select the elements you wish to click.
- Set the click action to "Left click" or "Right click".
- Set the "Maximum clicks".
This does not allow you to click a button in a list, perform actions and then click the next item in the list.
# CSS selectors and the Loop though data step
The Loop through data step can be used to loop through a list of custom CSS selectors. We would recommend a structure like the one below:
- Create a list of CSS selectors within the Google Sheet.
- Add a Read data from a Google Sheet step, configure it to read the list of CSS selectors.
- Add a Loop through data step, configure this to use the
[google-sheet-data]token output from the previous step. - Inside the "Loop through data" step, add a Click element step.
- Configure the "Click element" step to use the CSS selector: click "Select", then "Custom", then "Set selector from data" and select the
[google-sheet-data]token. - Click "Complete".
A sample of a Google Sheet with a list of custom selectors:
| A | |
|---|---|
| 1 | .button1 |
| 2 | .button2 |
| 3 | .button3 |
| 4 | .button4 |
| 5 | .button5 |
# The Jump to another step step
To automate the clicking of a single button multiple times, use the Jump to another step step or the Conditionally jump to another step step.
- Add a Click element step, configure using the Selector Tool.
- Add a Jump to another step step or a Conditionally jump to another step step, configure this to jump back to the "Click element" step to repeat the click.
- Set the "Maximum cycles" or configure the condition used to perform the jump.
# Using Javascript
Use the Write JavaScript step to write a JavaScript script to automate the clicking of the button. There are various methods that can be used to automate the clicking of a button:
- Using the JavaScript click (opens new window) method.
- Using the Puppeteer integration.
See our JavaScript snippets for some helpful starting points.