Setup

bl find

Find elements by CSS selector or semantic locator

Find elements by CSS selector or semantic locator

Usage

bl find [selector...] [OPTIONS]
bl find <command>

Arguments

ArgumentDescription
[selector...]CSS selector (optionally preceded by a URL to navigate first)

Options

OptionDescription
--allFind all matching elements
--limit <value>Maximum number of elements to return (with --all) (default 10)
--nth <value>Select the 0-based Nth match of the selector (default: first). Mutually exclusive with --last.
--lastSelect the last match of the selector. Mutually exclusive with --nth.
--headlessHide browser window (visible by default)
--jsonOutput as JSON
--session <value>Run this command in the named session (env: BL_SESSION; default: "default")

Global options

OptionDescription
-v, --verboseEnable debug logging

Examples

bl find "a"
# → @e1 [a] "More information..." @ (32,133) 140x18

bl find ".item" --nth 2
# → @e1 [div] "Third item" @ (16,220) 320x40  (0-based)

bl find ".item" --last
# → @e1 [div] "Last item" @ (16,900) 320x40

bl find "a" --all
# → @e1 [a] "Home" @ (16,12) 48x24  @e2 [a] "About"  ...

bl find text "Sign In"
# → @e1 [button] "Sign In" @ (312,428) 96x40

bl find role button
# → @e1 [button] "Submit" @ (312,428) 96x40

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

bl find text

Find element by text content

Usage

bl find text <text> [OPTIONS]

Arguments

ArgumentDescription
&lt;text&gt;Find element by text content

Options

OptionDescription
--headlessHide browser window (visible by default)
--jsonOutput as JSON
--session <value>Run this command in the named session (env: BL_SESSION; default: "default")

Global options

OptionDescription
-v, --verboseEnable debug logging

Examples

bl find text "Sign In"
# → @e1 [button] "Sign In" @ (312,428) 96x40

bl find role

Find element by ARIA role

Usage

bl find role <role> [OPTIONS]

Arguments

ArgumentDescription
&lt;role&gt;ARIA role to match

Options

OptionDescription
--name <value>Accessible name filter
--headlessHide browser window (visible by default)
--jsonOutput as JSON
--session <value>Run this command in the named session (env: BL_SESSION; default: "default")

Global options

OptionDescription
-v, --verboseEnable debug logging

Examples

bl find role button
# → @e1 [button] "Submit" @ (312,428) 96x40

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

bl find label

Find input by associated label text

Usage

bl find label <label> [OPTIONS]

Arguments

ArgumentDescription
&lt;label&gt;Find input by associated label text

Options

OptionDescription
--headlessHide browser window (visible by default)
--jsonOutput as JSON
--session <value>Run this command in the named session (env: BL_SESSION; default: "default")

Global options

OptionDescription
-v, --verboseEnable debug logging

Examples

bl find label "Email"
# → @e1 [input type="email"] placeholder="Email" @ (80,240) 320x36

bl find placeholder

Find element by placeholder attribute

Usage

bl find placeholder <placeholder> [OPTIONS]

Arguments

ArgumentDescription
&lt;placeholder&gt;Find element by placeholder attribute

Options

OptionDescription
--headlessHide browser window (visible by default)
--jsonOutput as JSON
--session <value>Run this command in the named session (env: BL_SESSION; default: "default")

Global options

OptionDescription
-v, --verboseEnable debug logging

Examples

bl find placeholder "Search..."
# → @e1 [input] placeholder="Search..." @ (80,240) 320x36

bl find testid

Find element by data-testid attribute

Usage

bl find testid <testid> [OPTIONS]

Arguments

ArgumentDescription
&lt;testid&gt;Find element by data-testid attribute

Options

OptionDescription
--headlessHide browser window (visible by default)
--jsonOutput as JSON
--session <value>Run this command in the named session (env: BL_SESSION; default: "default")

Global options

OptionDescription
-v, --verboseEnable debug logging

Examples

bl find testid "submit-btn"
# → @e1 [button] data-testid="submit-btn" @ (312,428) 96x40

bl find xpath

Find element by XPath expression

Usage

bl find xpath <expression> [OPTIONS]

Arguments

ArgumentDescription
&lt;expression&gt;Find element by XPath expression

Options

OptionDescription
--headlessHide browser window (visible by default)
--jsonOutput as JSON
--session <value>Run this command in the named session (env: BL_SESSION; default: "default")

Global options

OptionDescription
-v, --verboseEnable debug logging

Examples

bl find xpath "//div[@class='main']"
# → @e1 [div] "..." @ (0,64) 960x480

bl find alt

Find element by alt attribute

Usage

bl find alt <alt> [OPTIONS]

Arguments

ArgumentDescription
&lt;alt&gt;Find element by alt attribute

Options

OptionDescription
--headlessHide browser window (visible by default)
--jsonOutput as JSON
--session <value>Run this command in the named session (env: BL_SESSION; default: "default")

Global options

OptionDescription
-v, --verboseEnable debug logging

Examples

bl find alt "Logo"

bl find title

Find element by title attribute

Usage

bl find title <title> [OPTIONS]

Arguments

ArgumentDescription
&lt;title&gt;Find element by title attribute

Options

OptionDescription
--headlessHide browser window (visible by default)
--jsonOutput as JSON
--session <value>Run this command in the named session (env: BL_SESSION; default: "default")

Global options

OptionDescription
-v, --verboseEnable debug logging

Examples

bl find title "Close"

On this page