Frabot Keywords


Login

Use Case

Logs into any Frappe site using provided credentials.

Performs login via the login page by:

  • Navigating to the given URL

  • Entering the username and password

  • Clicking the Login button

  • Waiting for the home page or dashboard to load

Arguments

Argument

Description

url

Base URL of the Frappe site (e.g., http://localhost:8000)

username

Login username (e.g., administrator)

password

Corresponding password


Example Usage

Login    http://localhost:8000    administrator    admin

This opens the Frappe site, enters the admin credentials, and logs in.



Go To URL

Use Case

Navigates to a specific URL or Doctype page in a Frappe application.

  • If navigate_url is provided, it goes directly to that URL.

  • If Doctype is provided, it constructs the path as /app/<doctype> and navigates there.


Arguments

Argument

Description

Doctype

(Optional) Name of the Doctype to navigate to (e.g., User, Item)

navigate_url

(Optional) Full URL to open (e.g., http://localhost:8000/app/role)


Example Usage


Go To URL    navigate_url=http://localhost:8000/app/role

  • The second command opens the exact Role page URL.


Check URL

Use Case

Validates that the current browser URL contains the expected Doctype path, confirming that navigation to the correct page was successful.

Useful for asserting that the system is on the expected view (e.g., List or Form) of a specific Doctype.


Arguments

Argument

Description

doctype_name

The name of the Doctype expected to appear in the URL (e.g., User, Customer, Sales Invoice).


Example Usage

Check URL    User

This asserts that the current URL contains /app/user, ensuring the browser is on the User page.


Open Doctype

Use Case

Opens any Doctype, Report, or Page in a Frappe application using the search bar in the top navigation bar.

Searches for the specified name and opens the matching result.


Arguments

Argument

Description

doctype_name

The name of the Doctype, Report, or Page to open (e.g., Item, Sales Invoice, Stock Balance).


Example Usage

Open Doctype    Item

This will search for Item in the navbar and navigate to the Item List View.


New Doc

Use Case

Opens a new document form for the specified Frappe Doctype.

Automatically navigates to the list or module page (if not already there), then clicks the “Add” (or “New”) button to open a fresh form for data entry.


Arguments

Argument

Description

doctype_name

The name of the Frappe Doctype to open (e.g., Customer, Sales Invoice, etc.).


Example Usage

New Doc    Customer

This navigates to the Customer list view (if not already on it), and opens a new blank Customer form ready to be filled.


Fill

Use Case

Fills a specified field in a Frappe web form with a given value. Useful for automated data entry during UI testing.


Arguments

Argument

Description

field_name

The name or label of the field on the form.

value

The value to be entered or selected in the specified field.


Example Usage

Fill    document_type    Claim Book

This will find a select field named document_type on the form and select the option "Claim Book".



Click Button

Use Case

Clicks a button inside a Frappe form.

Targets the button based on the Doctype and fieldname (the internal name of the button). This is commonly used for actions like creating linked documents (e.g., "Make Delivery Note").


Arguments

Argument

Description

field_name

The internal fieldname of the button to click (e.g., make_delivery_note)


Example Usage

Click Button    make_delivery_note

This will click the "Make Delivery Note" button inside a Sales Invoice form.


Attach

Use Case

Attaches a file to a specific field in a Frappe form.

Useful for automating file uploads such as PDFs, images, or any document type, directly into a form field.

Arguments

Argument

Description

field_name

The fieldname where the file should be attached (e.g., attach_file)

path

The full file system path to the file (e.g., /path/to/file.pdf)

Example Usage

Attach    attach_file    /path/to/file.pdf

This attaches the file.pdf to the attach_file field in a Sales Invoice form.


Save Doc

Use Case

Saves the current form in a Frappe application.

Waits for the "Save" button to be available, clicks it, and waits for the form to complete the save operation.


Arguments

This keyword takes no arguments.


Example Usage

Save

This will save the currently open form.


Is Saved

Use Case

Checks if the current form is saved successfully within a specified timeout.

  • Waits until the document is saved.

  • Can optionally raise an error if it isn't saved in time.

  • Returns True if saved, False otherwise.


Arguments

Argument

Description

wait_time

(Optional) Maximum time to wait for the save status. Defaults to ${config}[max_wait_time].

raise_error

(Optional) Whether to raise an error if not saved (1 = Yes, 0 = No). Default is 1.


Example Usage

Is Saved
Is Saved    10s    0

  • The first call checks if the document is saved using default config values.

  • The second waits up to 10 seconds and does not raise an error if it fails — it will return False instead.



Get Field Value

Use Case

Retrieves the current value of a specified field from the active Frappe form.

Useful for validating or using field data during test execution.


Arguments

Argument

Description

field_name

The name of the field whose value needs to be fetched (e.g., customer_name, posting_date).


Example Usage

${value}=    Get Field Value    customer_name

This fetches the value of the customer_name field from the current form and stores it in ${value}.


Select All

Use Case

Selects all records displayed in the current list view.

Automatically clicks the "Select All" checkbox at the top of the list table to check every visible record.


Arguments

This keyword takes no arguments.


Example Usage

Select All

This selects all records in the currently active list view.