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

mouse_double_click

mouse_double_click($dx=-1,$dy=-1); -

Функция на вход принимает параметры:

  • $dx X
  • $dy Y

    :
  • true
  • false

    Пример использования
    <?php
    // Scenario: Demonstrates how to perform a double mouse click on a UI element
    
    $xhe_host = getenv("RPABOT_HOST_URL");
    if (!isset($path)){
        // Path to the init.php file for connecting to the XHE API
        $path = "../../../Templates/init.php";
        // Including init.php grants access to all classes and functionality for working with the XHE API
        require($path);
    }
    
    // Step: Get UI element for interaction (Debug Panel)
    $windowText = "[localhost";
    $parentWindow = WINDOW::$window->get_by_text($windowText);
    $debugPanelElement = $parentWindow->get_child_by_text("Debug Panel", true, true)->get_ui_element();
    
    if ($debugPanelElement && $debugPanelElement->is_exist()) {
        // Step: Wait a moment before double clicking
        sleep(1);
        
        // Example 1: Double click on the Debug Panel at specific coordinates
        $clickX = 100;
        $clickY = 90;
        $result = $debugPanelElement->mouse_double_click($clickX, $clickY);
        
        if ($result) {
            echo("Example 1: Successfully double clicked on Debug Panel at coordinates ($clickX, $clickY)\n");
        } else {
            echo("Example 1: Failed to double click on Debug Panel\n");
        }
    } else {
        echo("Example 1: Debug Panel element not found\n");
    }
    
    // Quit the application
    WINDOW::$app->quit();
    ?>
    # Additional paths
    import sys
    sys.path.insert(0, '../../../Templates PY/')
    
    xhe_host = "127.0.0.1:3039"
    from xweb_human_emulator import *
    
    # начало
    echo("<hr><font color=blue>windowinterface.xxxxxxxxx</font><hr>")
    
    # 1
    echo("1. Нажать двойную мышь над элементом : ");
    xhe=window.get_by_text("localhost").get_ui_element();
    qstart=xhe.get_by_property("Name" , "mouse_double_click.py");
    echo(qstart.mouse_double_click(2,2));
    
    # конец
    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 = Environment.GetEnvironmentVariable("RPABOT_HOST_URL");
    			InitXHE();
    
    			// начало
    			echo("<hr><font color=blue>windowinterface.mouse_double_click</font><hr>");
    				
    			// 1 
    			echo("1. Нажать двойную мышь над элементом : ");
    			var xhe=window.get_by_text("localhost").get_ui_element();
    			var qstart=xhe.get_by_property("Name" , "mouse_double_click.cs");
    			echo(qstart.mouse_double_click(2,2));
    
    			// конец
    			echo("\n\n");
    
    			app.quit();            
    	  }
    }
    // подключим функциональные объекты, если еще не подключен
    xhe_host="127.0.0.1:3039";
    echo=require("../../../Templates JS/init.js");
    
    // начало
    echo("<hr><font color=blue>windowinterface.mouse_double_click</font><hr>");
    
    // 1
    echo("1. Нажать двойную мышь над элементом : ");
    var xhe=window.get_by_text("localhost").get_ui_element();
    var qstart=xhe.get_by_property("Name" , "mouse_double_click.js");
    echo(qstart.mouse_double_click(2,2));
    
    // конец
    echo("\n");
    
    // Quit
    app.quit();

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