Add a new user to a Browserless account using a generated test email and a role selected from the roles exposed by the account UI.
Use Cases
Use when the caller asks to create or add a user under a Browserless account. The caller must be able to provide the one-time password sent during login.
Automation Flow
- Navigate directly to
https://www.browserless.io/account. - Enter the supplied account email in the login email field and submit. Wait for the OTP prompt, ask the user for the OTP, enter it, and submit.
- Navigate directly to
https://www.browserless.io/account/users. - Click the button whose visible text is
Add Users, then wait for the add-user form or dialog. - Generate a unique test email, for example
qa-test-${random-alphanumeric}@example.com, and enter it in the email field. Prefer an input associated with an Email label or matching an email placeholder; the input's DOM id is dynamically generated and must not be hard-coded. - Open the role combobox, read the visible
[role="option"]elements, and choose one role at random. Do not assume a fixed role name;Vieweris one observed option. - Click the button whose exact visible text is
Add Userto submit. - After the submission completes, run the following
evaluate()on the current page, substituting the generated email for{generated-email}in thetargetEmailvariable, to verify the created user and return structured rows:
(() => {
const targetEmail = "{generated-email}";
const rows = [...document.querySelectorAll('tr, [role="row"], li')]
.map((el) => ({
text: (el.innerText || "").replace(/\s+/g, " ").trim(),
cells: [...el.querySelectorAll('th, td, [role="cell"]')]
.map((cell) => (cell.innerText || "").replace(/\s+/g, " ").trim())
.filter(Boolean),
}))
.filter(
(row) =>
row.text && row.text.toLowerCase().includes(targetEmail.toLowerCase()),
);
return {
email: targetEmail,
found: rows.length > 0,
rows,
};
})();Possible Friction Points
- The account user-management page is directly reachable at
/account/users; no homepage navigation is needed after authentication. - Login requires an OTP after submitting the email, so pause for the user rather than attempting to guess or reuse an OTP.
- The email input and other form element ids are dynamically generated and are not durable selectors. Use accessible labels, placeholders, roles, or visible button text where possible.
- The add-user flow is modal/dialog based: open
Add Users, select a role through its combobox and[role="option"]entries, then submit with the exactAdd Userbutton. - Role names may change by account configuration. Enumerate the currently visible options and select randomly rather than hard-coding
Viewer,Admin, or another role. - Verify against the generated email because the users page can contain mixed row types and unrelated account text.