browserlane
CLI referenceInspect page

bl find

Find elements by CSS selector or semantic locator

Find elements by CSS selector or semantic locator

Usage

bl find [selector] [flags]
bl find [command]

Flags

FlagDescription
--allFind all matching elements
--limit intMaximum number of elements to return (with --all) (default 10)

Global flags

FlagDescription
--headlessHide browser window (visible by default)
--jsonOutput as JSON
-v, --verboseEnable debug logging

Examples

bl find "a"
# → @e1 [a] "More information..."

bl find "a" --all
# → @e1 [a] "Home"  @e2 [a] "About"  ...

bl find text "Sign In"
# → @e1 [button] "Sign In"

bl find role button
# → @e1 [button] "Submit"

bl find role heading --name "Example"
# Find heading with accessible name "Example"

bl find alt

Find element by alt attribute

Usage

bl find alt [alt] [flags]

Global flags

FlagDescription
--headlessHide browser window (visible by default)
--jsonOutput as JSON
-v, --verboseEnable debug logging

Examples

bl find alt "Logo"

bl find label

Find input by associated label text

Usage

bl find label [label] [flags]

Global flags

FlagDescription
--headlessHide browser window (visible by default)
--jsonOutput as JSON
-v, --verboseEnable debug logging

Examples

bl find label "Email"
# → @e1 [input type="email"] placeholder="Email"

bl find placeholder

Find element by placeholder attribute

Usage

bl find placeholder [placeholder] [flags]

Global flags

FlagDescription
--headlessHide browser window (visible by default)
--jsonOutput as JSON
-v, --verboseEnable debug logging

Examples

bl find placeholder "Search..."
# → @e1 [input] placeholder="Search..."

bl find role

Find element by ARIA role

Usage

bl find role [role] [flags]

Flags

FlagDescription
--name stringAccessible name filter

Global flags

FlagDescription
--headlessHide browser window (visible by default)
--jsonOutput as JSON
-v, --verboseEnable debug logging

Examples

bl find role button
# → @e1 [button] "Submit"

bl find role heading --name "Example"
# Find heading with accessible name "Example"

bl find testid

Find element by data-testid attribute

Usage

bl find testid [testid] [flags]

Global flags

FlagDescription
--headlessHide browser window (visible by default)
--jsonOutput as JSON
-v, --verboseEnable debug logging

Examples

bl find testid "submit-btn"
# → @e1 [button] data-testid="submit-btn"

bl find text

Find element by text content

Usage

bl find text [text] [flags]

Global flags

FlagDescription
--headlessHide browser window (visible by default)
--jsonOutput as JSON
-v, --verboseEnable debug logging

Examples

bl find text "Sign In"
# → @e1 [button] "Sign In"

bl find title

Find element by title attribute

Usage

bl find title [title] [flags]

Global flags

FlagDescription
--headlessHide browser window (visible by default)
--jsonOutput as JSON
-v, --verboseEnable debug logging

Examples

bl find title "Close"

bl find xpath

Find element by XPath expression

Usage

bl find xpath [expression] [flags]

Global flags

FlagDescription
--headlessHide browser window (visible by default)
--jsonOutput as JSON
-v, --verboseEnable debug logging

Examples

bl find xpath "//div[@class='main']"
# → @e1 [div.main] ...

On this page