humanemulator.net — справка. Продукт, демо и покупка — на хуманэмулятор.рф | Демо | Купить | API | лог изменений

get_type

get_type(); - DOM

:
  • / null

    Пример использования
    <?php
    
    // Scenario: For current page, find an input element and get its type
    // Description: For current page, find an input element and get its type
    // Classes used: XHEInput, XHEInterface, XHEBrowser, XHEApplication
    
    // Connection string to XHE API
    $xhe_host = "localhost:7010";
    
    // Path to init.php file
    if (!isset($path))
    {
        // Path to init.php file for connecting to XHE API
        $path = "../../../Templates/init.php";
        // When connecting init.php file, all functionality of classes for working with XHE API will be available
        require($path);
    }
    
    // Navigate to polygon page if page was not loaded earlier
    WEB::$browser->navigate(TEST_POLYGON_URL . "input.html");
    
    // Example 1: Get type of input by its name
    
    // Get input element by name
    $targetInput = DOM::$input->get_by_name("Name");
    
    // Check that DOM element was found
    if ($targetInput->inner_number != -1)
    {
        // Get type of input
        echo($targetInput->get_type() . "\n");
    }
    
    // Example 2: Get type of input in frame 0 and its dimensions by its name
    
    // Get input element by name in frame 0
    $targetInput = DOM::$input->get_by_name("Name", 0);
    
    // Check that DOM element was found
    if ($targetInput->inner_number != -1)
    {
        // Get type and dimensions of input
        echo($targetInput->get_type() . " " . $targetInput->get_width() . " " . $targetInput->get_height() . "\n");
    }
    
    // Stop application
    WINDOW::$app->quit();
    ?>
    # Additional paths
    import sys
    sys.path.insert(0, '../../../Templates PY/')
    
    xhe_host = "127.0.0.1:7024"
    from xweb_human_emulator import *
    
    # начало
    echo("<hr><font color=blue>interface.xxxxxxxxx</font><hr>")
    
    # 1 
    echo("1. Перейдем на полигон : ");
    echo(browser.navigate("https://rpa-bot.ru/wiki/poligon/input.html"),"<br>");
    
    # 2 
    echo("2. Получить тип ввода по его имени : ");
    echo(input.get_by_name("Name").get_type()+"<br>");
    
    # 3 
    echo("3. Получить тип ввода в 0 фрейме и его размеры по его имени : ");
    obj=input.get_by_name("Name","0");
    echo(obj.get_type()," ")
    echo(obj.get_width()," ")
    echo(obj.get_height(),"<br>");
    
    # конец
    echo("<hr><br>")
    
    # Quit
    app.quit()
    #region using
    
    using System;
    using System.Diagnostics;
    using System.Collections.Generic;
    using System.Linq;
    using System.IO;
    using System.Text;
    using System.Threading;
    
    using XHE;
    using XHE.XHE_DOM;
    using XHE.XHE_System;
    using XHE.XHE_Window;
    using XHE.XHE_Web;
    
    #endregion
    
     class Program:XHEScript
     {
    	  static void Main(string[] args)
    	  {
    			// init XHE
    			server = "localhost:7010";
    			InitXHE();
    
    			// начало
    			echo("<hr><font color=blue>interface.get_tag</font><hr>");
    
    			// 1 
    			echo("1. Перейдем на полигон : ");
    			echo(browser.navigate("https://rpa-bot.ru/wiki/poligon/input.html")+"<br>");
    
    			// 2 
    			echo("2. Получить тип ввода по его имени : ");
    			echo(input.get_by_name("Name").get_type()+"<br>");
    
    			// 3 
    			echo("3. Получить тип ввода в 0 фрейме и его размеры по его имени : ");
    			XHEInterface obj=input.get_by_name("Name","0");
    			echo(obj.get_type()+" "+obj.get_width()+" "+obj.get_height()+"<br>");
    
    			// конец
    			echo("\n\n");
    
    			app.quit();            
    	  }
    }
    // IE + Chrom
    
    // подключим функциональные объекты, если еще не подключен
    xhe_host="127.0.0.1:7024";
    echo=require("../../../Templates JS/init.js");
    
    // начало
    echo("<hr><font color=blue>interface.get_tag</font><hr>");
    
    // 1 
    echo("1. Перейдем на полигон : ");
    echo(browser.navigate("https://rpa-bot.ru/wiki/poligon/input.html")+"<br>");
    
    // 2 
    echo("2. Получить тип ввода по его имени : ");
    echo(input.get_by_name("Name").get_type()+"<br>");
    
    // 3 
    echo("3. Получить тип ввода в 0 фрейме и его размеры по его имени : ");
    let obj=input.get_by_name("Name","0");
    echo(obj.get_type()+" "+obj.get_width()+" "+obj.get_height()+"<br>");
    
    // конец
    echo("\n");
    
    // Quit
    app.quit();

    =============================================
    Interface    Объекты    DOM  System  Vision  Web  Window        
    =============================================
    Если что-то непонятно или необходимо узнать или считаете что надо добавить по работе этой функции, пишите в комментарии или на наш форум.