Macro: Record and Replay Automated Actions
Macro is available in the Starter plan and above.
Macro allows you to record a sequence of actions performed on a web page. Some examples of webpage actions are scrolling, button clicks, or form-fill up on the page. Once you record the Macro, you can replay it on the webpage. In Distill, you can use Macros in two ways:
- For monitoring the desired section of the webpage. In this case, the content displays only after the web page actions (button click, scroll, etc) are performed.
- As a Macro action after Distill checks the web page for changes. When Distill detects a change in your monitor, Macro will replay the actions on the web page.
You will need to follow two steps for monitoring webpages that need Macro:
- Create a Macro that records the flow of actions on the web page.
- Use the saved Macro and play it before monitoring the section on the web page.
How to create a Macro?
You can create Macros from the web app or the browser extension.
- Click on the “Macros” option from the hamburger icon. It will open the “Macros” page at https://monitor.distill.io/#/w/0/macros/.
Enter the “Macro Name”, the “URL” in the respective placeholder and click on the “Add New Macro” button. It will open the URL in Distill’s remote browser.
Once the page loads, you can perform the web page actions to display the final content. You will also see the corresponding steps for each action in the right panel as shown below.
[Optional] Click on the “Replay” button to ensure that the correct flow of actions has been captured.
Click on the “Save” button to save the Macro.
The Macro list will open after saving a Macro and will show the newly added Macro.
How to use a Macro for monitoring?
You can use a Macro to make selections on a page for monitoring. This will work for both cloud and local monitors. To use it for a local monitor, you will have to change the device from the Option page or the Watchlist.
Here are the steps to use a Macro:
Click on the “Add Webpage” button from the Watchlist. Enter the URL and click on “Go”.
From the visual selector toolbar, click on the “Macro” menu option. It will show all the saved Macro for the URL. Select the Macro from the drop-down list.
Click on the play button for the Macro. This will play the recorded actions and reach the final page where you can make selections to monitor.
Once Macro finishes playing, turn “on” the selection mode to make selections. Save the selections.
You can configure the settings like check interval, device and others from the Options page and Save.
How to use Macro actions after checks?
Macro actions are available for a local monitor.
- Create a Macro as explained above to record the actions on the web page.
- Create a monitor for that web page by clicking on “Add Webpage” from the Watchlist.
- Add the “Run Macro” action from the actions list. It is available in the Options window.
In this case, when Distill checks the monitor and detects a change, macro actions will trigger. It will open the web page in a new tab and replay the actions you have recorded in the macro.
How to edit a Macro?
You can edit, add, or delete a step for an existing Macro.
- Navigate to the Macro list at https://monitor.distill.io/#/w/0/macros/.
- Click on the “Open Recorder” button for the Macro that you need to edit.
- Click on the “overflow icon” as shown below for a step and edit as needed.
- Save the Macro. Once edited, it will apply to all monitors using this Macro.
Steps and their descriptions
- CLICK (
click): Simulates a mouse click on a specified element, such as a button or a link, triggering any associated actions or events.
- DRAG (
drag): Replicates a drag-and-drop action by clicking, holding, and moving an element from one location to another within the browser.
- FOCUS (
focus): Sets the focus on a specified element, like an input field or a dropdown menu, making it the active target for user interactions.
- KEYPRESS (
keypress): Simulates a keyboard key press event on a focused element, such as typing a letter or pressing Enter.
- MOUSEMOVE (
mousemove): Mimics the movement of the mouse pointer over a specified element, triggering any related hover effects or events.
- OPEN (
open): Opens a specified URL in the browser, navigating to the desired web page.
- SCROLL (
scroll): Scrolls the browser window to a specified position or element, bringing the target into view.
- SELECT (
select): Selects an option within a dropdown menu or similar element, making it the active choice.
- TYPE (
type): Simulates typing text into a focused input field, such as a text box or search bar.
- WAIT_DOC (
wait_doc): Pauses the macro execution until the web page’s content is fully loaded.
- WAIT_FOR_DURATION (
wait_for_duration): Introduces a pause in the macro execution for a specified duration of time, typically in milliseconds.
- WAIT_FOR_ELEMENT (
wait_for_element): Waits for a specified element to become available on the web page before proceeding with the macro execution.
Currently, Macro feature is in beta and under active development. If you need help with a macro or have a URL that is not handled yet, feel free to contact us using our forum https://forums.distill.io/. You can explore existing discussions or post to get help on any topic.