-
Notifications
You must be signed in to change notification settings - Fork 15
Custom Login Scripts
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.
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.
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']")
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']")
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']")
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")
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']")
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")
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)
To find the XPath for an element:
- Open the website in your browser
- Right-click on the element (input field, button, etc.)
- Select Inspect or Inspect Element
- In the Developer Tools, right-click on the highlighted HTML element
- Select Copy → Copy XPath or Copy full XPath
| 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 |
fillUsername()
fillPassword()
clickSubmitButton()
fillUsername("//input[@id='email']")
fillPassword("//input[@id='password']")
clickSubmitButton("//button[@type='submit']")
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']")
fillUsername()
fillPassword()
fillText("//input[@id='pin']", "12345")
clickSubmitButton()