The Browser Automation integration opens a website on a schedule, takes a screenshot of it, and makes that screenshot available to the Browser Automation app on your screens. It can show public pages, and it can sign in to pages that need a username and password, such as a dashboard, a booking overview or a status page.
You tell the integration where things are on the page, for example the cookie button, the username field and the login button. You do this with CSS selectors, which are short addresses that point to one specific element on a web page. The section How to find a CSS selector further down shows you exactly how to find them, step by step.
Before you start, see Working with integrations in Q-Play if you haven't set up an integration before.
Check this list before you start, so you don't spend time on a site that won't work.
Create a new Browser Automation integration and fill in:
All the settings for the website itself are made on a job. One integration can hold many jobs, so you can add one job per website, page or account, each with its own login.
Add a new screenshot job to the integration. Give it a name that tells you which page it shows, for example "Sales dashboard". You will pick this job in the app later.
In "Sign in to the website?", choose:
In "Website link", enter the address the integration should open first.
Open the page in your browser and copy the address from the address bar.
Most websites show a cookie banner the first time you visit. The integration visits the site as a new visitor every time, so it sees the banner on every run. In "Cookie banner?", choose:
If the banner doesn't appear on a run, this step is skipped and the run continues. The integration also checks for the banner one more time just before it takes the screenshot, so banners that show up late are caught too.
To find out whether a banner is inside a frame, see Elements inside a frame or shadow root under How to find a CSS selector.
Skip this step if you chose No, the page is public in step 3.
Fill in the fields below. Each selector field needs the CSS selector of one element on the login page. See How to find a CSS selector for how to find each one, and Which element to pick for each field for exactly which element to inspect.
After clicking the login button, the integration waits 5 seconds for the site to sign in.
Skip this step if you chose No, the page is public in step 3.
In "After signing in", choose:
In "Wait for element", enter the selector of an element on the page you want on screen. The integration waits until this element appears before it takes the screenshot. If it never appears, the run fails and the previous screenshot stays on screen.
The default is body, which waits for any page. That works, but it doesn't tell the integration whether the right page has loaded. A better choice is something that is part of the content you care about, for example the main chart or the table of bookings.
If you're signing in, pick an element that only shows when you're signed in, for example your account menu. That way, if the login fails, the run fails instead of showing a screenshot of the login page.
In "What to show", choose which part of the page ends up in the screenshot:
One element only and Area around an element follow the element when the page's content changes, so they keep showing the right part.
With Area around an element and Fixed position, two more fields appear:
Both are 0 by default.
In "Image width" and "Image height", enter the size of the screenshot in pixels. The default is 1920 × 1080, which fits a 16:9 screen. For a 9:16 (portrait) screen, use 1080 × 1920.
Anything below the image height on the page is not included in the screenshot.
In "Zoom", choose from 50% to 150%. The default is 100%. Zoom out to fit a long page into the screenshot, or zoom in to make a small page easier to read from a distance.
In "Wait before screenshot", choose how long the integration waits before it takes the screenshot: 2, 5, 10, 20 or 30 seconds. The default is 5 seconds. This gives the page time to finish loading its content and charts. If the screenshot shows loading spinners or blank areas, choose a longer wait.
In "Refresh schedule", choose how often a new screenshot is taken: Every 15 min, Every 30 min or Every hour. The default is Every 30 min. "Schedule type" only has one option, Scheduled, so you can leave it as it is.
If you're signing in, the integration signs in again on every run.
Save the job, and run it manually the first time. After that, it runs on the refresh schedule. See Working with integrations in Q-Play for how to run a job.
If a run fails, check the job's log. See Working with integrations in Q-Play for how to find it. A line starting with "Waiting for" shows which selector could not be found. Find that selector again with the steps below, correct it, and save.
When the job has taken its first screenshot, add the Browser Automation app to a slide to show it on your screens. See Browser Automation app.
A CSS selector is a short piece of text that points to one specific element on a web page, such as a field, a button or a box. You find it with the developer tools that are built into Google Chrome and Microsoft Edge. The steps are the same in both browsers. You don't need to change anything on the website and you don't need to know how to code.
Open a private window: in Chrome it's called an Incognito window, in Edge it's called an InPrivate window. Press Ctrl+Shift+N on Windows or Cmd+Shift+N on Mac.
Go to the page in the private window. The integration always visits as a brand new visitor who is not logged in, and a private window shows you the page the same way, with the cookie banner and the login form.
Right-click the exact element you need a selector for, for example inside the username field, and choose Inspect. In Edge the menu item may be called Inspect or Inspect element.
The developer tools open next to the page. In the Elements panel, one line of the page's code is highlighted. That line is the element you right-clicked.
Tip: If the highlighted line isn't the element you meant, hover over the lines just above and below it. The browser highlights the matching element on the page as you hover, so you can see which line belongs to which element. You can also click the arrow icon in the top-left corner of the developer tools and then click the element on the page to select it.
Right-click the highlighted line in the Elements panel and choose Copy, then Copy selector. The selector is now on your clipboard, ready to paste into the integration.
Do not use Copy XPath or Copy full XPath. The integration only accepts CSS selectors.
If the copied selector is very long, see If the copied selector is long or doesn't work below.
Copy selector often gives a short selector like #username, which is what you want. Sometimes it gives a long one, like #root > div > div:nth-child(3) > form > div:nth-child(2) > input. A long selector like that describes the exact position of the element, so it breaks as soon as the site moves something around.
In that case, look at the highlighted line in the Elements panel and write a short selector yourself from what it says:
Avoid ids and classes that look random, for example id="input-8f3a2c" or class="css-1x2y3z". They usually change when the page loads again, and the selector stops working.
Here are some typical examples:
| What | Example of the highlighted line | Selector |
|---|---|---|
| Username field | input id="username" | #username |
| Username field | input type="email" name="email" | input[name="email"] |
| 'Next' button | button id="next-step" | #next-step |
| Password field | input type="password" name="pwd" | input[type="password"] |
| Login button | button type="submit" class="btn login-btn" | button[type="submit"] |
| Cookie banner button | button id="accept-cookies" | #accept-cookies |
| Cookie banner button | button data-action="accept" | button[data-action="accept"] |
Some elements are not on the page until you do something. For example, the password field on a two-step login only appears after you type the username and click Next, and a login form might only appear after you click a "Log in" button.
To find the selector for those, go through the steps by hand in your private window until the element is visible, then right-click it and choose Inspect as usual.
Sometimes an element sits inside a separate, embedded part of the page. You can spot this in the Elements panel when you see one of these a few lines above the highlighted line:
The integration can't click or type inside these.
| Field | Pick this element |
|---|---|
| Cookie banner button selector | The button that closes the cookie banner, not the text next to it. |
| Cookie banner selector | The outer box of the whole banner, including the dark backdrop behind it. Click upwards in the Elements panel, one line at a time, until the whole banner and backdrop are highlighted on the page. |
| 'Show login' button selector | The button or link you click to show the login form. |
| Username field selector | The field you type the username or email in, not its label. |
| 'Next' button selector | The button that takes you from the username to the password. |
| Password field selector | The field you type the password in. |
| Login button selector | The button that signs in. |
| Wait for element | Something on the page you want on screen. When signing in, something that only shows when you're signed in, for example your account menu. |
| Element selector | The box around the part of the page you want to show, for example a chart, table or box. Click upwards in the Elements panel until the whole part is highlighted on the page. |