Skip to content

Custom Login Scripts

Jonas B. edited this page Feb 16, 2026 · 3 revisions

Custom Login Script

Some websites have complex login flows that cannot be handled by Enterr's automatic form detection. For these cases, you can write a custom login script to control the login process step by step.

Overview

Custom login scripts use a simple, easy-to-learn syntax. Each command is written on its own line and executed in order from top to bottom.

Commands

fillUsername(xpath)

Fills the username field with the stored username for the website.

Parameters:

  • xpath (optional): XPath selector for the username input field. If omitted, Enterr will try to find the field automatically.

Examples:

fillUsername()
fillUsername("//input[@id='email']")
fillUsername("//input[@name='username']")

fillPassword(xpath)

Fills the password field with the stored password for the website.

Parameters:

  • xpath (optional): XPath selector for the password input field. If omitted, Enterr will try to find the field automatically.

Examples:

fillPassword()
fillPassword("//input[@id='password']")
fillPassword("//input[@type='password']")

clickSubmitButton(xpath)

Clicks the submit/login button.

Parameters:

  • xpath (optional): XPath selector for the submit button. If omitted, Enterr will try to find the button automatically.

Examples:

clickSubmitButton()
clickSubmitButton("//button[@type='submit']")
clickSubmitButton("//input[@value='Sign In']")

fillText(xpath, value)

Fills any text field with a custom value. Useful for additional fields like pins or custom form fields.

Parameters:

  • xpath (required): XPath selector for the text field.
  • value (required): The text value to enter.

Examples:

fillText("//input[@id='company']", "My Company")
fillText("//input[@name='security_answer']", "Blue")

clickButton(xpath)

Clicks any button or clickable element on the page.

Parameters:

  • xpath (required): XPath selector for the button.

Examples:

clickButton("//button[text()='Next']")
clickButton("//a[@class='continue-link']")
clickButton("//div[@id='login-btn']")

openUrl(url)

Navigates to a different URL. Useful for multi-page login flows or when you need to navigate to a specific login page.

Parameters:

  • url (required): The full URL to navigate to.

Examples:

openUrl("https://example.com/login")
openUrl("https://accounts.example.com/signin")

wait(milliseconds)

Pauses script execution for a specified duration. Useful for waiting for page loads, animations etc.

Parameters:

  • milliseconds (required): Time to wait in milliseconds (1000ms = 1 second).

Examples:

wait(1000)
wait(2000)
wait(500)

Finding XPath Selectors

To find the XPath for an element:

  1. Open the website in your browser
  2. Right-click on the element (input field, button, etc.)
  3. Select Inspect or Inspect Element
  4. In the Developer Tools, right-click on the highlighted HTML element
  5. Select CopyCopy XPath or Copy full XPath

Common XPath Patterns

Pattern Description
//input[@id='email'] Input with specific ID
//input[@name='username'] Input with specific name attribute
//input[@type='password'] Password input field
//button[@type='submit'] Submit button
//button[text()='Login'] Button with specific text
//button[contains(text(),'Sign')] Button containing text
//a[@class='login-link'] Link with specific class
//div[@id='container']//input Input inside a specific container

Example Scripts

Basic Login (with auto-detection)

fillUsername()
fillPassword()
clickSubmitButton()

Basic Login (with explicit selectors)

fillUsername("//input[@id='email']")
fillPassword("//input[@id='password']")
clickSubmitButton("//button[@type='submit']")

Multi-Step Login

Some sites show username and password on separate pages:

fillUsername("//input[@id='username']")
clickButton("//button[text()='Next']")
wait(2000)
fillPassword("//input[@id='password']")
clickSubmitButton("//button[text()='Sign In']")

Login with Additional Fields

fillUsername()
fillPassword()
fillText("//input[@id='pin']", "12345")
clickSubmitButton()