humanemulator.net — справка.
Продукт, демо и покупка — на
хуманэмулятор.рф
|
Демо
|
Купить
|
API
|
лог изменений
scroll
scroll($sсroll_action); - скролировать элемент (доступна с верси 4.6.30)Функция на вход принимает параметры:
- scrollbarDown - Down scroll arrow is at the specified location.
- scrollbarHThumb - Horizontal scroll thumb or box is at the specified location.
- scrollbarLeft - Left scroll arrow is at the specified location.
- scrollbarPageDown - Page-down scroll bar shaft is at the specified location.
- scrollbarPageLeft - Page-left scroll bar shaft is at the specified location.
- scrollbarPageRight - Page-right scroll bar shaft is at the specified location.
- scrollbarPageUp - Page-up scroll bar shaft is at the specified location.
- scrollbarRight - Right scroll arrow is at the specified location.
- scrollbarUp - Up scroll arrow is at the specified location.
- scrollbarVThumb - Vertical scroll thumb or box is at the specified location.
- down - Composite reference to scrollbarDown.
- left - Composite reference to scrollbarLeft.
- pageDown - Composite reference to scrollbarPageDown.
- pageLeft - Composite reference to scrollbarPageLeft.
- pageRight - Composite reference to scrollbarPageRight.
- pageUp - Composite reference to scrollbarPageUp.
- right - Composite reference to scrollbarRight.
- up - Composite reference to scrollbarUp.
Пример использования
<?php // Scenario: Scroll a DOM element in different directions // Description: For current page, find a DOM element and scroll it in different directions // Classes used: XHEBody, 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); } // Example 1: Scroll a body element in different directions // Navigate to test site echo WEB::$browser->navigate(TEST_SITE_URL); sleep(3); // Get DOM element <body> by number 0 $targetBody = DOM::$body->get_by_number(0); // Check that DOM element was found if ($targetBody->inner_number != -1) { // Scroll page down 3 times echo $targetBody->scroll("pageDown"); echo $targetBody->scroll("pageDown"); echo $targetBody->scroll("pageDown"); usleep(100000); // Scroll down 3 times echo $targetBody->scroll("down"); echo $targetBody->scroll("down"); echo $targetBody->scroll("down"); usleep(100000); // Scroll up 3 times echo $targetBody->scroll("up"); echo $targetBody->scroll("up"); echo $targetBody->scroll("up"); usleep(100000); // Scroll page up 3 times echo $targetBody->scroll("pageUp"); echo $targetBody->scroll("pageUp"); echo $targetBody->scroll("pageUp"); usleep(100000); } // Stop 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>interface.xxxxxxxxx</font><hr>") # 1 echo("1. Перейдем на полигон : ") echo(browser.navigate("http://htmlbook.ru/html/body/scroll"),"<br>") # 2 echo("2. Проскролируем divs : ") for i in range (0,100): echo(div.get_by_number(i).scroll("pageDown")," <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.scroll</font><hr>"); // 1 шаг echo("1. Перейдем на полигон : "); echo(browser.navigate("http://htmlbook.ru/html/body/scroll")+"<br>"); // 2 шаг echo("2. Проскролируем divs : "); for (int i=0;i<100;i++) echo(div.get_by_number(14).scroll("pageDown")+" <br>"); // конец echo("\n\n"); app.quit(); } }
// IE + Chrom // подключим функциональные объекты, если еще не подключен xhe_host="127.0.0.1:7010"; echo=require("../../../Templates JS/init.js"); // начало echo("<hr><font color=blue>interface.scroll</font><hr>"); // 1 шаг echo("1. Перейдем на полигон : "); echo(browser.navigate("http://htmlbook.ru/html/body/scroll")+"<br>"); // 2 шаг echo("2. Проскролируем divs : "); for (i=0;i<100;i++) echo(div.get_by_number(i).scroll("pageDown")+" <br>"); // конец echo("\n"); // Quit app.quit();
=============================================
Interface Объекты DOM System Vision Web Window
=============================================
Если что-то непонятно или необходимо узнать или считаете что надо добавить по работе этой функции, пишите в комментарии или на наш форум.