Skip to main content

untilJsReturnsAValue

Waits until given js snippet returns a value. If running the snippet throws errors they will be suppressed until a value is received.

untilJsReturnsAValue(snippet)

Uses Script timeout.

Parameters#

  • snippet: A js snippet as string

Returns#

  • return value from the js snippet

Example#

# get an attribute of an element. If element is not found immediately wait until it renders on pageuntilJsReturnsAValue("document.getElementsByName('product-phone')[0].getAttribute('data-price')")