Reference

execute

Will execute a given natural language instruction. Please refer to our Prompt Guide for best practices.

# simple instructions
gd.execute("tap on the login button")

# more abstract instructions
gd.execute("Navigate to the settings screen")

# complex instructions
gd.execute("Check that you see a list of hotel room options, if so tap on the cheapest room option")

assert

Verify something without taking any action. The function will pass or throw an error

gd.assert(f"The total price is $price")

assertBulk

Check multiple conditions are met in one go. The function will throw an error if any of the assertions is not true.

gd.assertBulk([
    f"The total price is ${price}",
    "The VAT is calculated correctly",
    "The delivery date is shown in the format dd.mm.YYYY"
])

checkBulk

Check multiple conditions are met in one go. The function will return a object with true and false values for each conditions.

const assertResults = gd.assertBulk([
    f"The total price is ${price}",
    "The VAT is calculated correctly",
    "The delivery date is shown in the format dd.mm.YYYY"
])

extract

Extract information from current screen. Returns an object with the extracted values.

# example to extract flight informationn from a screen
flightInformation = gd.extract([
    "departureAirportCode",
    "destinationAirportCode",
    "departureTime",
    "destinationTime",
    "travelTime"
])

# which can later be used in assertions
gd.assertBulk([
    f"departue airport is ${flightInformation[departureAirportCode]}",
    f"detination airport is ${flightInformation[destinationAirportCode]}"
])

Last updated