Select and assert

in Japanese(日本語)

This page covers the basics of grabbing an element and verifying its state: the difference between tap, exist, and select, and how the value/text assertion commands target "whatever was grabbed last."

tap vs. exist vs. select

Assertions target "the element grabbed last," not a selector

Text/value assertion commands (textIs, valueIs, and the rest of that family — see Text assertions) do not take a selector. You grab an element first, then assert on it. These three forms are exactly equivalent:

select("#login_btn").textIs("Log In")            // chained on the return value
select("#login_btn"); lastElement.textIs("Log In") // grabbed element made explicit
select("#login_btn"); textIs("Log In")            // implicit — acts on the last-grabbed element

textIs("#login_btn", "Log In") — passing the selector directly to the assertion — does not compile. Grab first, assert second.

Chaining off exist

exist("#total")
    .textStartsWith("Total")
    .textEndsWith("USD")

Any command that operates on a single already-grabbed element can chain this way, and the same set works as an implicit form (a free function that takes no selector; the same arguments as the chained form) on the element exist just grabbed:

exist("#total"); textStartsWith("Total")

Implicit waiting

Element lookups retry until a timeout instead of failing on the first miss:

Both accept an explicit waitSeconds: (fractional seconds allowed, e.g. waitSeconds: 1.2) to override the default for a single call.

Visibility and text visibility check

requireVisible: false skips the covered/off-screen check that normally backs exist (where it flips a match to failure) and select (where it returns an empty element). This extra visibility pass is on by default (it does not run when both fmTextVisibilityCheck and ocrTextVisibilityCheck are set to false, and then the flag has nothing to skip).