예제 #1
0
def execute_command(driver, command):
    element = ""
    mode = ""

    if common.execute_non_element_action(driver, command):
        return ""  # We dont need to return mode here.

    # We need to add sleep here because, some UI elements take time to refresh.
    time.sleep(1)

    element, mode, _ = platform.find_element(driver, command)

    common.execute_action(driver, command, element)

    # We are returning mode to save it into the lock file.
    return mode
예제 #2
0
def execute_command(driver, command):
    element = ""
    mode = ""

    if common.execute_non_element_action(driver, command):
        return ""  # We dont need to return mode here.

    # We need to add sleep here because, some UI elements take time to refresh.
    time.sleep(1)

    try:
        element, mode, _ = platform.find_element(driver, command)
    except Exception:
        if command[TYPE] != CLICK_IF_PRESENT_ACTION:
            raise Exception("Element Not Found!")
        else:
            return ""

    common.execute_action(driver, command, element)

    # We are returning mode to save it into the lock file.
    return mode