get_all_texts
get_all_texts($visibled=true,$mained=true); - данная функция используется для получения текстов всех окон заданного типа.Функция на вход принимает параметры:
После отработки функция возвращает результат своей работы в скрипт :
<?php // Scenario: Get all window texts with different visibility and main window filters $xhe_host = "localhost:7010"; 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); } // Example 1: Get texts of visible main windows $visible1 = true; $main1 = true; echo("Example 1: Get texts of visible main windows\n"); $texts1 = WINDOW::$window->get_all_texts($visible1, $main1); // Split the string by <br> to get individual window texts $textArray1 = explode("<br>", $texts1); echo("Found " . count($textArray1) . " visible main window texts\n"); // Example 2: Get texts of visible windows (including child windows) $visible2 = true; $main2 = false; echo("Example 2: Get texts of visible windows (including child windows)\n"); $texts2 = WINDOW::$window->get_all_texts($visible2, $main2); // Split the string by <br> to get individual window texts $textArray2 = explode("<br>", $texts2); echo("Found " . count($textArray2) . " visible window texts\n"); // Example 3: Get texts of main windows (including invisible) $visible3 = false; $main3 = true; echo("Example 3: Get texts of main windows (including invisible)\n"); $texts3 = WINDOW::$window->get_all_texts($visible3, $main3); // Split the string by <br> to get individual window texts $textArray3 = explode("<br>", $texts3); echo("Found " . count($textArray3) . " main window texts\n"); // Example 4: Get texts of all windows (including invisible and child windows) $visible4 = false; $main4 = false; echo("Example 4: Get texts of all windows (including invisible and child windows)\n"); $texts4 = WINDOW::$window->get_all_texts($visible4, $main4); // Split the string by <br> to get individual window texts $textArray4 = explode("<br>", $texts4); echo("Found " . count($textArray4) . " total window texts\n"); // Quit the application WINDOW::$app->quit(); ?>
# Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7010" from xweb_human_emulator import * # начало echo("<hr><font color=blue>window.xxxxxxxxx</font><hr>") # 1 echo("1. Получим текст видимых главных окон : <br>") echo(window.get_all_texts(true,true),"<br><br>") # 2 echo("2. Получим текст видимых окон : <br>") echo(window.get_all_texts(true,false),"<br><br>") # 3 echo("3. Получим текст главных окон : <br>") echo(window.get_all_texts(false,true),"<br><br>") # 4 echo("4. Получим текст всех окон : <br>") echo(window.get_all_texts(false,false),"<br><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>window.get_all_texts</font><hr>"); // 1 шаг echo("1. Получим текст видимых главных окон : \n\n"); echo(window.get_all_texts(true,true)+"\n\n"); // 2 шаг echo("2. Получим текст видимых окон : \n\n"); echo(window.get_all_texts(true,false)+"\n\n"); // 3 шаг echo("3. Получим текст главных окон : \n\n"); echo(window.get_all_texts(false,true)+"\n\n"); // 4 шаг echo("4. Получим текст всех окон : \n\n"); echo(window.get_all_texts(false,false)+"\n\n"); // конец echo("\n\n"); app.quit(); } }
// подключим функциональные объекты, если еще не подключен xhe_host="127.0.0.1:7010"; echo=require("../../../Templates JS/init.js"); // начало echo("<hr><font color=blue>window.get_all_texts</font><hr>"); // 1 шаг echo("1. Получим текст видимых главных окон : <br>"); echo(window.get_all_texts(true,true)+"\n"); // 2 шаг echo("2. Получим текст видимых окон : <br>"); echo(window.get_all_texts(true,false)+"\n"); // 3 шаг echo("3. Получим текст главных окон : <br>"); echo(window.get_all_texts(false,true)+"\n"); // 4 шаг echo("4. Получим текст всех окон : <br>"); echo(window.get_all_texts(false,false)+"\n"); // конец echo("\n"); // Quit app.quit();
=============================================
Window Объекты DOM System Vision Web Window
=============================================
если что-то непонятно или необходимо узнать или считаете что надо добавить по работе этой функции, пишите в комментарии или на наш форум
.