• EN
    RU

ui/toggle

toggle(); – переключить
После отработки функция возвращает результат своей работы роботу:
  • true  – переключение прошло успешно
  • false  – переключение произвести не удалось




  • Пример использования toggle (Python):

    # Additional paths
    import sys
    sys.path.insert(0, '../../../Templates PY/')
     
    xhe_host = "127.0.0.1:3039"
    from xweb_human_emulator import *
     
    # start
    echo("<hr><font color=blue>ui.xxxxxxxxx</font><hr>")
     
    # 1 
    echo("1. Toggle: ");
    xhe=window.get_by_text("localhost").get_ui_element();
    echo(xhe.toggle());
     
    # end
    echo("<hr><br>")
     
    # notify the environment that the robot has finished running
    echo(app.quit())

    Пример использования toggle (JS):

    // подключим объект для управления Р.Бот, если еще не подключен
    xhe_host="127.0.0.1:3039";
    echo=require("../../../Templates JS/init.js");
     
    // начало
    echo("<hr><font color=blue>ui.xxx</font><hr>");
     
    // 1 
    echo("1. Переключим: ");
    var xhe=window.get_by_text("localhost").get_ui_element();
    echo(xhe.toggle());
     
    // конец
    echo("<hr><br>");
     
    // уведомляем среду что скрипт закончил работать
    echo(app.quit());