WUX サーバ と Selenium 3 を使用したWUX 監視

The user experience monitoring consists of recording automated tasks for both web navigation (PWR/WUX) and interaction with the Windows system desktop and applications (PDR).

ユーザエクスペリエンス監視 は、Web ナビゲーション (PWR/WUX) と Windows システムのデスクトップとアプリケーション (PDR) とのやり取りの両方の自動タスクの記録する仕組みから成ります。

These recordings can range from a mouse click on a web browser, typing text, or performing a web search, to opening an application on the desktop. This allows the configuration of functions and automatic recording for later execution to seek results.

これらの記録は、Webブラウザでのマウスクリック、テキスト入力、Web検索の実行、デスクトップでのアプリケーションの起動など、多岐にわたります。これにより、機能の設定や自動記録が可能になり、後で実行して結果を求めることができます。

Both monitoring systems are used for executing automated web navigation tasks through the Pandora Web Robot Daemon (PWRD).

両方の監視の仕組みは、Pandora Web Robot Daemon (PWRD) を通してウェブブラウジングタスクを実行するために利用されます。

The UX system performs these monitorings via the EndPoint installed on a machine, while the WUX (Web User Experience) monitoring relies on a server integrated within Pandora FMS.

UX システムは マシンにインストールされたエンドポイント を介してこれらの監視を実行しますが、WUX (Web User Experience) 監視は Pandora FMS 内に統合されたサーバに依存します。

PWRD is a service that provides the necessary tools to automate web browsing sessions. It uses a file that contains a list of required actions to navigate the web portal being monitored.

PWRD は、Web 閲覧セッションを自動化するために必要なツールを提供するサービスです。監視対象の Web ポータルをナビゲートするために必要なアクションのリストを含むファイルを使用します。

Additionally, the UX monitoring allows the execution of automated tasks that interact with the desktop and MS Windows® system applications. These types of tasks cannot be performed with WUX.

加えて、UX 監視は、Windows デスクトップおよびシステムアプリケーションの自動化タスクを実行することができます。このタイプのタスクは、WUX では実行できません。

Pandora FMS UX is a system that runs automated tasks, providing the Pandora FMS Server with a report on the execution results, time spent, and screenshots of any errors found.

Pandora FMS UX は、自動タスクを実行し、実行結果、所要時間、見つかったエラーのスクリーンショットに関するレポートを Pandora FMS サーバに提供するシステムです。

If a task automation system is available, Pandora FMS UX also allows the execution of pre-written scripts and monitors their execution.

タスク自動化システムが利用可能な場合、Pandora FMS UX では事前に作成されたスクリプトの実行も可能であり、その実行を監視することもできます。

  • It is important to clarify the use of this type of monitoring. Both methods are based on executing the monitoring via plugins on the EndPoints installed on the respective machines.
  • どのタイプの監視を使用するかを明確にすることが重要です。どちらの方法も、それぞれのマシンにインストールされたエンドポイント上のプラグインを介して監視を実行することを前提としています。

Considering the differences between UX and WUX monitoring, in general, UX monitoring must follow a series of prerequisites related to the environment being monitored, with the following prior steps:

UX 監視と WUX 監視の違い を考慮して、一般に、UX 監視では、監視対象の環境に関連する一連の前提条件を満たす必要があり、以下の事前手順を実行する必要があります。

  • Configure a profile in Mozilla Firefox®.
  • Install a Selenium® service.
  • Distribute PWR in the system.
  • Install the Selenium® IDE for Mozilla Firefox®.
  • Record a PWR session.
  • Mozilla Firefox® のプロファイル設定
  • Selenium® サービスのインストール
  • システム上への PWR の展開
  • Mozilla Firefox® 用の Selenium® IDE の展開
  • PWR セッションの保存

For the standard execution of pre-recorded sessions, the Pandora UX Plugin is used in its latest version 28-04-2022.

事前に保存されたセッションの標準的な実行には、Pandora UX プラグインの最新バージョン 28-04-2022 を使用します。

For deploying Selenium on WUX servers, a container stack will be used for rapid deployment and easy scaling.

WUX サーバでの Selenium デプロイでは、コンテナベースのスタックを使用して、迅速なデプロイと容易なスケーリングを実現します。

Docker® and Docker Compose® must be installed; Rocky Linux® 9 is recommended as the base operating system.

Docker® と Docker Compose® がインストールされている必要があります。ベースオペレーティングシステムとしては Rocky Linux® 9 を推奨します

To install Docker, follow the documentation according to the operating system being used:

Docker をインストールするには、使用しているオペレーティングシステムに応じたドキュメントに従ってください。

For Selenium®, use the official images for the installation and deployment of the stack:

Selenium® の場合、スタックのインストールとデプロイメントには公式イメージを使用します。

In the Selenium® repository, different images with browsers are available. For Pandora FMS, Mozilla Firefox® and Google Chrome® containers are recommended.

Selenium® リポジトリには、ブラウザに対応した様々なイメージが用意されています。Pandora FMS の場合は、Mozilla Firefox® および Google Chrome® コンテナを推奨します。

To deploy the Selenium stack, a dedicated directory must be created for the task. Inside it, create a compose.yaml file with the necessary configuration:

Seleniumスタックをデプロイするには、タスク専用のディレクトリを作成する必要があります。その中に、必要な設定を記述した compose.yaml ファイルを作成します。

# To execute this docker-compose yml file use `docker-compose -f  up`
# Add the `-d` flag at the end for detached execution
# version: "3"
services:
  selenium-hub:
    image: pandorafms/pandorafms-selenium-hub
    mem_limit: 2G
    container_name: selenium-hub-v3
    logging:
        driver: "json-file"
        options:
            max-file: "5"
            max-size: "4m"
            mode: "non-blocking"
    environment:
      - TZ=Europe/Amsterdam
    ports:
      - "4444:4444"

  chrome:
    image: pandorafms/pandorafms-selenium-node-chrome
    mem_limit: 2G
    volumes:
      - /dev/shm:/dev/shm
    depends_on:
      - selenium-hub
    logging:
        driver: "json-file"
        options:
            max-file: "5"
            max-size: "4m"
            mode: "non-blocking"
    environment:
      - TZ=Europe/Amsterdam
      - HUB_HOST=selenium-hub
      - HUB_PORT=4444

  firefox:
    image: pandorafms/pandorafms-selenium-node-firefox
    mem_limit: 2G
    volumes:
      - /dev/shm:/dev/shm
    depends_on:
      - selenium-hub
    logging:
        driver: "json-file"
        options:
            max-file: "5"
            max-size: "4m"
            mode: "non-blocking"
    environment:
      - TZ=Europe/Amsterdam
      - HUB_HOST=selenium-hub
      - HUB_PORT=4444

In the previous example, you must make the necessary modifications for each case, such as memory limit, time zone, number of nodes, etc.

前の例では、メモリ制限、タイムゾーン、ノード数など、各ケースに応じて必要な変更を行う必要があります。

To start and run the container with the defined configuration, inside the directory created for the task:

タスク用に作成されたディレクトリ内で、定義された構成でコンテナを起動して実行するには、次の手順を実行します。

docker compose up -d

To check the services running in the container:

コンテナ内で実行中のサービスを確認するには:

docker compose ps

To view the status and logs of the Selenium services:

Selenium サービスのステータスと ログ を表示するには:

docker compose logs

Once the necessary checks are done, to verify that the grid is working correctly and the workers have been registered as defined in the configuration file, it will be necessary to access the following URL:

必要なチェックが完了したら、グリッド が正しく動作していること、および ワーカー が設定ファイルで定義されたとおりに登録されていることを確認するために、次の URL にアクセスする必要があります。

http://<ip_selenium_server>:4444/grid/console

If you need to increase the number of workers (X, Y):

ワーカーの数(XY)を増やす必要がある場合:

docker compose scale chrome=X firefox=Y

Selenium operates as a HUB where a container is launched acting as a grid to deploy the necessary worker containers.

Selenium は、必要な ワーカー コンテナをデプロイするための グリッド として機能するコンテナが起動される HUB として動作します。

To use the centralized mode (WUX), the following configuration must be applied to the Pandora FMS server.

集中モード (WUX) を使用するには、Pandora FMS サーバに次の設定を適用する必要があります。

Regardless of the chosen mode, once started, you can begin assigning navigation session executions by adding the WUX Server configuration parameters to the Pandora FMS server's configuration file.

選択したモードに関係なく、起動したら、WUX サーバ設定パラメータを Pandora FMS サーバの設定ファイルに追加することで、ナビゲーションセッション実行の割り当てを開始できます。

Add the following configuration at the end of the /etc/pandora/pandora_server.conf file
(replace <ip_wux_host> with the server's IP address; if it's the same server running the Pandora FMS Server, use 127.0.0.1):

/etc/pandora/pandora_server.conf ファイルの最後に次の設定を追加します (<ip_wux_host> をサーバーの IP アドレスに置き換えます。Pandora FMS サーバを実行しているサーバと同じ場合は 127.0.0.1 を使用します)。

wuxserver 1
wux_host <ip_wux_host>
wux_port 4444

The server's configuration file includes a new token to clean any sessions that may be queued every time the Pandora FMS server is started.

サーバの設定ファイルには、Pandora FMS サーバが起動されるたびにキューに入れられる可能性のあるセッションをすべて消去するための新しい トークン が含まれています。

clean_wux_sessions 1 #(default)

Pandora FMS スレッド管理

  1. The management of the wuxserver threads is done automatically when the pandora_server service starts.
  2. This is done based on the number of the lower browser nodes in the Selenium hub:
  1. wuxserver スレッドの管理は、pandora_server サービスの起動時に自動的に行われます。
  2. これは、Selenium hub 内の下位ブラウザノードの数に基づいて行われます:
  • If there are 2 Firefox nodes and 2 Chrome nodes configured in the hub, the number of threads for the wuxserver will be 2.
  • If there is 1 Firefox node and 4 Chrome nodes configured in the hub, the number of threads will be 1.
  • If there are 6 Firefox nodes configured in the hub, the number of threads will be 6.
  • hub に Firefox ノードが 2 台、Chrome ノードが 2 台設定されている場合、wuxserver のスレッド数は 2 になります。
  • hub に Firefox ノードが 1 台、Chrome ノードが 4 台設定されている場合、スレッド数は 1 になります。
  • hub に Firefox ノードが 6 台設定されている場合、スレッド数は 6 になります。

Always keep in mind that each thread indicates the sessions that can be sent simultaneously from the wuxserver to the Selenium hub.

各スレッドは、wuxserver から Selenium hub に同時に送信できるセッションを示すことを常に念頭に置いてください。

If it is necessary to launch web transactions against Microsoft® browsers, you need to configure a machine (physical or virtual) with the desired version of MS Windows® and set up the driver following the official documentation.

Microsoft® ブラウザに対して Web トランザクションを開始する必要がある場合は、必要なバージョンの MS Windows® でマシン (物理または仮想) を構成し、公式ドキュメントに従ってドライバーを設定する必要があります。

Documentation for installing the MS Internet Explorer® driver:

Internet Explorer® ドライバインストールドキュメント:

https://www.selenium.dev/documentation/ie_driver_server/

It is recommended to use the 32-bit version of driver 3.141 to avoid performance issues with the 64-bit version.

64 ビットバージョンのパフォーマンスの問題を回避するには、ドライバー 3.141 の 32 ビットバージョンを使用することをお勧めします。

Documentation for installing the Microsoft Edge® driver:

Microsoft Edge® ドライバーインストールドキュメント:

https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

For running Selenium, Java® must be installed on the MS Windows® device.

Selenium を実行するには、MS Windows® デバイス に Java® がインストールされている必要があります。

To check if Java® is installed, run:

Java® がインストールされているかどうかを確認するには、次のコマンドを実行します。

java -version

The output should be similar to the following:

次のような出力が得られます。

The JAR file for Selenium is also required to run the server locally and register it on the grid. It can be obtained at:

サーバをローカルで実行し、グリッド に登録するには、Selenium の JAR ファイルも必要です。これは以下の場所から入手できます。

https://www.selenium.dev/downloads/

To start the Microsoft Edge® server, execute, in a terminal in the directory where the downloaded JAR file is located (all of this in one line, broken down for simplification):

Microsoft Edge® サーバを起動するには、ダウンロードした JAR ファイルが配置されているディレクトリのターミナルで、次のコマンドを実行します ( すべてを 1 行にまとめ、簡略化のために分割しています )。

java
  -jar selenium-server-standalone-<VER>.jar
  -port 5555 -role node
  -hub http://<ip_selenium_server>:4444/grid/register
  -browser "browserName=MicrosoftEdge, platform=WINDOWS, maxInstances=1"

To start the Internet Explorer® server, the command is similar, specifying the path <PATH> to the downloaded driver (all of this in one line, broken down for simplification):

Internet Explorer® サーバを起動する場合も、コマンドは同様で、ダウンロードした driver へのパス <PATH> を指定します (簡略化のために、すべてを 1 行に分割しています):

java
  -Dwebdriver.ie.driver=<PATH>IEDriverServer.exe
  -jar selenium-server-standalone<VER>.jar
  -port 5555
  -role node
  -hub http://ip_selenium_server:4444/grid/register
  -browser "browserName=internet explorer, platform=WINDOWS, maxInstances=1"

The MS Windows® firewall must be configured to allow traffic on the port numbers specified in the execution command (in this documentation, 5555 and 4444 were used).

実行コマンドで指定されたポート番号 (このドキュメントでは、55554444 が使用されています) のトラフィックを許可するように MS Windows® ファイアウォールを構成する必要があります。

For version 3 of Selenium, both old and new recordings will be supported, although with partial compatibility with older versions.

Selenium バージョン 3 では、古いバージョンとの互換性は 部分的 ですが、古い記録と新しい記録の両方がサポートされます。

To record a new session, the Selenium IDE extension must be installed in the browser of choice.

新しいセッションを記録するには、目的のブラウザに Selenium IDE 拡張機能をインストールする必要があります。

Firefox

https://addons.mozilla.org/es/firefox/addon/selenium-ide/

Chrome

https://chrome.google.com/webstore/detail/selenium-ide/mooikfkahbdckldjjndioackbalphokd

The icon will be used to start the recording environment once the extension is installed.

拡張機能がインストールされると、アイコン を使用して記録環境を起動できるようになります。

Clicking it will open a menu that allows starting new recording projects.

これをクリックすると、新しい記録プロジェクトを開始できるメニューが開きます。

Once the recording is complete, you will get a result similar to this:

記録が行われると、次のような結果になります。

Aside from the functionality provided by Selenium, Pandora FMS includes custom commands to extract information from the target being monitored.

Selenium によって提供される機能の他に、Pandora FMS には監視対象から情報を抽出するための カスタムコマンド が含まれています。

コマンド

The list of compatible commands for use in Pandora FMS can be found in the following link.

Pandora FMS で使用できる互換性のあるコマンドの一覧は、こちら にあります。

録画を行う際の推奨事項

Here are a few recommendations and tips for recording transactions with Selenium IDE and integrating the more complex commands with Pandora FMS:

ここでは、Selenium IDE を使用してトランザクションを記録し、より複雑なコマンドを Pandora FMS と統合するための推奨事項とヒントをいくつか紹介します。

  • Break the transaction into phases whenever possible. This way, the modules that will be created for status, times, and screenshots will be segmented, making it easier to identify where the transaction failed.

  • Use the Selenium command set speed and wait for to avoid false negatives. When executing a transaction, Selenium commands have no default delay between them, meaning some may not have a completion time or timeout. This causes the transaction to execute as quickly as possible, but if the webpage is a bit slow or takes a second longer to load, the check may fail. A common scenario: after executing a click command and changing pages, if the next element to be interacted with is delayed by a second, it won’t be found, and the check will fail.
    To avoid this, use the set speed command, which adds a delay in milliseconds between commands. It is recommended to set this at the start of the transaction. Also, for cases where page loading or element appearance is known to be delayed, use the commands wait for element present, wait for visible, and wait for text, where you can set the waiting time in milliseconds before marking the transaction as failed. While these commands significantly improve check reliability, they also increase the time it takes to execute the transaction.

  • Check the elements. Use commands like assert and verify in their various forms. For example, finishing a transaction with a click does not guarantee that the page opened by the clicked element will actually load, only that clicking the element is possible. If a verify text command is added to text that only loads after the click, it will confirm that the page linked by the click is available.

  • Use store window handle for transactions where you switch windows. A window change (with select window) may fail if the identifier for the initial window is not stored beforehand.

  • Use xpath when the Target fails due to CSS identifier or when you want to search for content on the page. By default, the Selenium IDE recorder uses the CSS locator in the Target, but it also records the locator by xpath, so you can see all the locators it saves by clicking on the Target box in the recorder:
  • 可能な場合はいつでも、トランザクションを段階的に分割します。このようにして、状態、時間、スクリーンショットで作成されたモジュールがセグメント化され、トランザクションが失敗したときにそれらを見つけやすくなります。

  • 誤検知を回避するには、selenium コマンド set speed および wait for を使用します。トランザクションを実行するとき、selenium コマンドには、1つのコマンド実行終了から次のコマンドが実行されるまでのデフォルトの遅延がなく、一部のコマンドにもタイムアウトがありません。これにより、トランザクションは可能な限り最短時間で実行されますが、非常に高速に実行することにより、Web がやや遅かったり、ロードに数秒余分にかかる場合、チェックが失敗する可能性があります。たとえば、“click” コマンドを実行して他のページに移動した後、新しいページの要素を使って動作するコマンドがあった場合、読み込みが 1秒遅れると、その要素は見つかりません。新しいページのチェックは失敗に終わります。このような状況を回避するために、コマンド “set speed” があります。これは、各コマンドの間に Target フィールドに指定されたミリ秒数の遅延を追加します。トランザクションの開始時に設定することをお勧めします。ページの読み込みや要素の表示に数秒かかることがわかっている場合は、コマンド “wait for element present” もあります。“wait for visible ” と “wait for test” では、トランザクションを失敗として判断する前に、要素がページに表示されるのを待つ時間をミリ秒単位で設定できます。これらのコマンドを使用すると、チェックの信頼性が大幅に向上しますが、トランザクションの実行にかかる時間も長くなることを考慮することが重要です。

  • 既存の要素を確認します。このためには、“assert” や “verify” などのコマンドをさまざまな場面で使用します。たとえば、クリックでトランザクションを終了しても、クリックした要素を新しいページが開くことは保証されません。要素をクリックできることを保証するだけです。クリック後にのみ読み込まれることがわかっている “verify test” を導入すると、クリックによって送信されたページが使用可能かどうかを確認することができます。

  • ウィンドウまたはタブ間を移動するトランザクションでは、“store window handle” を使用します。初期ウィンドウに識別子をあらかじめ保存していない場合、ウィンドウの変更(“select window” を使用)は失敗する可能性があります。

  • Target by CSS が失敗した場合またはページ内のコンテンツを検索したい場合は、xpath を使用します。デフォルトでは、Selenium IDE レコーダは CSS ロケータ要素の Target にロードしますが、xpath によってロケータもロードします。レコーダの Target ボックスをクリックすると、保存されているすべてのロケータを表示できます。

Additionally, using xpath paths, you can search for text inside the tags of the page, making recordings more dynamic. In the screenshot above, you could use an xpath to search for the text “Innovadores de la monitorización” within all span tags on the page, not just a specific locator.

さらに、xpath を使用すると、ページのタグ内のテキストを検索して、より動的なレコーディングができます。上記のキャプチャでは、特定のロケータではなく、ページのすべてのスパンタグで “Monitoring Innovators” というテキストを検索する xpath を使用できることがわかりました。

  • Correct usage of the execute script command. This command runs a piece of JavaScript code in the window where it is located in the transaction. It is recommended to read the guide to understand its usage and the different options available: https://ui.vision/rpa/docs/selenium-ide/executescript.
    However, the use of previously stored variables (via the store text command, for example) should be placed in double quotes for Pandora FMS’s webdriver to interpret them correctly.
  • “execute script” コマンドの正しい利用。“execute script” コマンドは、現在選択されているフレームまたはウィンドウのコンテキストでJavaScript のスニペットを実行します。 このガイド( https://ui.vision/rpa/docs/selenium-ide/executescript )を読んで、その使用法と提供されるさまざまなオプションについて学ぶことをお勧めします。ただし、以前に保存された変数の使用(たとえば、“store text” コマンドは、Pandora FMS Web ドライバが正しく解釈できるように、二重引用符で囲む必要があります。

This is an example of a variable stored with store text and then used in execute script, so that Pandora FMS’s server correctly interprets it. This use of the variable in quotes will fail when running the script in the Selenium IDE recorder:

これは、Pandora FMS サーバが正しく解釈できるように、変数を store text で保存し、execute script で使用する例です。この引用符で囲んだ変数の使用は、Selenium IDE レコーダーで スクリプト を実行する際にエラーとなります。

Once you have a recorded browsing session, it’s time to deploy it as a Module in the Pandora FMS Web Console.

ブラウジングセッションの記録が完了したら、それを Pandora FMS Web コンソールにモジュールとして展開します。

To do this, go to any agent associated with a server that has WUX functionality enabled and click on the Create Module button:

これを行うには、WUX 機能が有効になっているサーバに関連付けられている任意のエージェント に移動し、モジュールの作成(Create Module) ボタンをクリックします。

By clicking the Create button, you will need to fill out the fields presented in the form (only those related to this topic are shown):

作成(Create) ボタンをクリックすると、フォームに表示されるフィールドに入力する必要があります (このトピックに関連するフィールドのみが表示されます)。

  • Name: WUX Module (Parent); remember that all submodules with monitoring results will be dependent on this new module.

  • Execute tests from: Indicates which WUX Server will execute the check. By default, it is set to None, so select a server from the list.

  • Run performance tests: Specifies whether to run performance tests, i.e., monitor the browsing experience and also the performance statistics of the target website access (field Target web site).

  • Browser: Web browser to execute the check. Compatibility with IE and Edge browsers is experimental, and tests may not work as expected.

    The indicated browser must be listed in the grid or Selenium server used by the WUX server.

  • User data dir: Optional, only if Google Chrome is used, it allows specifying a directory for data.

  • Profile: Optional, only if Google Chrome is used, it allows specifying a user profile. If the profile name does not exist, the default profile will be used.

  • Accept insecure certificates: If enabled, it will accept any insecure certificate (self-signed, expired, etc.) as part of the browsing process.

    This option is only available for Google Chrome® and Mozilla Firefox® browsers with a Selenium 3 server.

  • Upload your selenium test in html or side (only Selenium 3) format: Use the Select file button to upload the content of the previously recorded browsing session files.

  • 名前(Name): WUX モジュール ()。監視結果を持つすべてのサブモジュールは、この新しいモジュールに依存することに注意してください。

  • テスト実行元(Execute tests from): チェックを実行する WUX サーバーを指定します。デフォルトでは なし(NOne) に設定されているため、リストからサーバーを選択します。

  • パフォーマンステストの実行(Run perfoemance tests): パフォーマンステストを実行するかどうかを指定します。つまり、ブラウジングエクスペリエンスと、対象 Web サイトへのアクセスのパフォーマンス統計を監視します (対象 Web サイト(Target web site) フィールド)。

  • ブラウザ(Browser): チェックを実行する Web ブラウザ。 IE および Edge ブラウザとの互換性は試験段階であり、テストは期待どおりに動作しない可能性があります。

    指定されたブラウザは、WUX サーバーが使用する グリッド または Selenium サーバにリストされている必要があります。

  • ユーザデータディレクトリ(User data dir): オプション。Google Chrome を使用する場合のみ、データ用のディレクトリを指定できます。

  • プロファイル(Profile): オプション。Google Chrome を使用する場合のみ、ユーザープロファイルを指定できます。 プロファイル名が存在しない場合は、デフォルトのプロファイルが使用されます

  • 安全でない証明書を受け入れる(Accept insecure certificates):有効にすると、ブラウジングプロセスの一部として、安全でない証明書(自己署名証明書、期限切れ証明書など)を受け入れます。

    このオプションは、Selenium 3 サーバを搭載した Google Chrome® および Mozilla Firefox® ブラウザでのみ使用できます。

  • HTML または Side(Selenium 3 のみ)形式で Selenium テストをアップロードする(Upload your selenium test in html or side (only Selenium 3)ファイルを選択(Select file) ボタンを使用して、以前に記録したブラウジングセッションファイルの内容をアップロードします。

カスタムマクロ

The functioning of custom macros involves replacing certain text strings in the browsing session file with customizable values.

カスタムマクロの機能では、ブラウジングセッションファイル内の特定のテキスト文字列をカスタマイズ可能な値に置き換えることができます。

For web analysis modules, this functionality has been improved to allow dynamic macros, which enable these values to be translated into variable dates and times.

Web 分析モジュールでは、この機能が改善され、動的マクロ が可能になり、これらの値を 可変の日付と時刻 に変換できるようになりました。

Why this functionality?

なぜこのような機能があるのか?

Suppose you need to monitor, via a browsing session, the correct functioning of a web-based room reservation application.

ブラウザセッションを通じて、ウェブベースの会議室予約アプリケーションが正しく機能しているかを監視する必要があるとします。

If you set a fixed date and time when filling out the form, the system may cancel the reservation because at some point it will be in the past.

フォームに記入する際に固定の日時を設定すると、いつの間にか過去の日時になってしまうため、システムによって予約がキャンセルされる可能性があります。

It is also possible that there is a maximum time limit for making that reservation, and that the system forces you to reserve the room within a specific time frame.

予約に最大時間制限があり、特定の時間枠内に部屋を予約するようにシステムによって強制される 可能性もあります。

To avoid having to edit the macro every few days, and to not worry about the configuration part, you can use dynamic macros, telling the system to always reserve the meeting room for the day after the web test.

数日ごとにマクロを編集する必要をなくし、構成部分を気にせずに済むように、動的マクロを使用して、Web テストの翌日に会議室を常に予約するようにシステムに指示することができます。

To use this functionality, the values must follow a specific format, allowing the following possible replacements:

この機能を使用するには、値が特定の形式に従う必要があり、次の置換が可能になります。

  • @DATE_FORMAT: current date/time with user-defined format.
  • @DATE_FORMAT_nh: hours.
  • @DATE_FORMAT_nm: minutes.
  • @DATE_FORMAT_nd: days.
  • @DATE_FORMAT_ns: seconds.
  • @DATE_FORMAT_nM: month.
  • @DATE_FORMAT_nY: years.
  • @DATE_FORMAT: 現在の日付/時刻をユーザー定義形式で指定する。
  • @DATE_FORMAT_nh: 時間.
  • @DATE_FORMAT_nm: 議事録.
  • @DATE_FORMAT_nd: 日.
  • @DATE_FORMAT_ns: おかわり.
  • @DATE_FORMAT_nM: 月.
  • @DATE_FORMAT_nY: 年.

Where “n” can be an unsigned (positive) or negative number, and FORMAT follows the standard of Perl's strftime:

ここで、“n” は符号なし(正)または負の数で、FORMAT は Perl の strftime の標準に従います。

@DATE_%Y-%m-%d %H:%M:%S
@DATE_%H:%M:%S_300s
@DATE_%H:%M:%S_-1h

The information generated by WUX will be displayed in the form of modules, and enabling the view in hierarchical mode in the list of modules will help to display the information much more clearly:

WUX によって生成された情報はモジュールの形式で表示され、モジュールのリストで階層モードで表示を有効にすると、情報がより明確に表示されます。

Within this hierarchy are:

この階層には次のものがあります:

  • module_Global_Status: It will indicate the overall status of the entire navigation.
  • モジュール_Global_Status: ナビゲーション全体のoverallステータスを示すものを含みます。
  1. If there is a recording, it gives the status of the WUX recording.
  2. If Run performance Test is enabled but recording is not included, the status of the Global Status module is that of the check performed when these modules are obtained.
  1. 記録がある場合は、WUX 記録のステータスが表示されます。
  2. パフォーマンステストの実行(Run performance Test) が有効になっているが、記録が含まれていない場合、グローバルステータスモジュールのステータスは、これらのモジュールの取得時に実行されたチェックのステータスになります。
  • module_Global_Time: It will indicate the total time spent on the entire navigation.
  • module_Phase X: Phase name_Status: Indicates the navigation status during phase X.
  • module_Phase X: Phase name_Time: Indicates the time spent in phase X.
  • module_Global_Screenshot: Contains an image with the result of the navigation error, only generated in case of error:
  • モジュール_Global_Time: ナビゲーション全体に費やされた合計時間が表示されます。
  • モジュール_Phase X: フェーズ名_Status: フェーズ X 中のナビゲーションステータスを示します。
  • モジュール_Phase X: フェーズ名_Time: フェーズ X に費やされた時間を示します。
  • モジュール_Global_Screenshot: ナビゲーションエラーの結果を示す画像が含まれます。

By accessing the agent's WUX Console, you can view additional details about the transaction and its phases:

エージェントの WUX コンソール(WUX Console) にアクセスすると、トランザクションとそのフェーズに関する追加の詳細を表示できます。

Website statistics are summarized in the following concepts:

ウェブサイトの統計は、次の概念にまとめられます。

  • Stats_TT: Total time to obtain the website.
  • Stats_TDNS: Total time taken to resolve the target IP address.
  • Stats_TTCP: Time spent connecting via TCP.
  • Stats_TSSL: Time taken to establish SSL communication.
  • Stats_TST: Time elapsed until data transfer began.
  • Stats_TTC: Time transferring data; will group all resource transfer times.
  • Stats_TTR: Time spent transferring the page content.
  • Stats_TTR_main: Time spent transferring the HTML code.
  • Stats_TTR_image: Time spent transferring image resources (png|jpg|jpeg|bmp|tiff|gif|webp|svg).
  • Stats_TTR_css: Time spent transferring style sheets.
  • Stats_TTR_js: Time spent transferring JavaScript files.
  • Stats_TT: ウェブサイトを取得するための合計時間。
  • Stats_TDNS: ターゲットIPアドレスの解決にかかる合計時間。
  • Stats_TTCP: TCP経由での接続にかかった時間。
  • Stats_TSSL: SSL通信の確立にかかる時間。
  • Stats_TST: データ転送が開始されるまでの経過時間。
  • Stats_TTC: データ転送時間。すべてのリソース転送時間を集約する。
  • Stats_TTR: ページ内容の転送にかかる時間。
  • Stats_TTR_main: HTMLコードの転送にかかる時間。
  • Stats_TTR_image: 画像タイプのリソースの転送にかかる時間 (png|jpg|jpeg|bmp|tiff|gif|webp|svg).
  • Stats_TTR_css: スタイルシートの転送にかかる時間。
  • Stats_TTR_js: JavaScriptファイルの転送にかかる時間。

Alerts associated with web analysis modules follow the same operating dynamics as the entire alert system in Pandora FMS.

Web 分析モジュールに関連付けられたアラートは、Pandora FMS の アラートシステム 全体と同じ動作ダイナミクスに従います。

For compatibility, it is recommended to assign alert templates to subelements autogenerated by the web analytics module:

互換性を確保するために、Web 分析モジュールによって自動生成されたサブ要素にアラートテンプレートを割り当てることをお勧めします。

  • The state of global navigation.
  • Time threshold alerts.
  • Alerts with notification template set to “always” for result image capture modules.
  • グローバルナビゲーションの状態。
  • 時間しきい値でアラート。
  • 結果画像キャプチャモジュールの警告テンプレートが “always” に設定されたアラート。

In order to display user navigation information, two types of widgets have been added to the Dashboards: Agent WUX transaction and WUX transaction stats:

ユーザナビゲーション情報を表示するために、ダッシュボードに 2 種類のウィジェットを追加しています: エージェント WUX トランザクション(Agent WUX transaction)WUX トランザクション統計(WUX transaction stats):

  • run: Run a test.
  • build_transaction: Pre-build a transaction based on the last test (internal).
  • get_transaction: Returns the current transaction, always used to retrieve results, phase order, and variables.
  • sessions: Retrieves the list of sessions present in the hub.
  • kill_sessions: Deletes all existing sessions in the hub.
  • run: テストを実行します。
  • build_transaction: 過去のテスト(内部)に基づいてトランザクションを事前構築します。
  • get_transaction: 常に結果、フェーズの順序で、現在のトランザクションを返します。変数を取得するために使用されます。
  • sessions: Hub に存在するセッションの一覧を取得します。
  • kill_sessions: Hub 内の既存のセッションをすべて削除します。

  • extract: Combines source and proprietary code for extraction.
  • storeExtraction: Store the result of extract in a variable.
  • dispatchEvent: Triggers a JavaScript event on a given element.
  • takeElementScreenshot: Take a screenshot of a specific element.
  • phase_start: Start a phase and transform the test into a WUX transaction.
  • phase_end: Complete a phase.
  • extract: 'ソース' と独自のコードを組み合わせて抽出します。
  • storeExtraction: 抽出結果を変数に格納します。
  • dispatchEvent: 指定された要素で Javascript イベントを発生させます。
  • takeElementScreenshot: 特定の要素のスクリーンショットを撮ります。
  • phase_start: フェーズを開始し、テストを WUX トランザクションに変換します。
  • phase_end: フェーズを完了します。

  • getValue: Extract a value.
  • getValue: 値を取得します:

getValue;module_name;module_type;capture_REGEX

  • getVariable: Extracts a specific value from a variable.
  • getVariable: 変数から特定の値を取得します。

getVariable;module_name;module_type;variable_name

  • getScreenshot: Take a screenshot.
  • getScreenshot: スクリーンショットを取得します:

getScreenshot;module_name

All custom commands must appear in the test file (.side) as comments. Otherwise, the test will fail when run in the Selenium extension.

独自のコマンドはすべて、コメントとしてテストファイル(.side)に記述する必要があります。 そうしないと、Selenium 拡張機能でのテストに失敗します。

  • addSelection
  • answerOnNextPrompt
  • assert
  • assertAlert
  • assertChecked
  • assertConfirmation
  • assertEditable
  • assertElementPresent
  • assertElementNotPresent
  • assertNotChecked
  • assertNotEditable
  • assertNotSelectedValue
  • assertNotText
  • assertPrompt
  • assertSelectedValue
  • assertSelectedLabel
  • assertText
  • assertTitle
  • assertValue
  • check
  • chooseCancelOnNextConfirmation
  • chooseCancelOnNextPrompt
  • chooseOkOnNextConfirmation
  • click
  • clickAt
  • close
  • doubleClick
  • doubleClickAt
  • dragAndDropToObject
  • echo
  • editContent
  • else
  • elseIf
  • end
  • executeScript
  • executeAsyncScript
  • if
  • mouseDown
  • mouseDownAt
  • mouseOver
  • mouseUp
  • mouseUpAt
  • open
  • pageLoadTimeout
  • pause
  • removeSelection
  • select
  • selectFrame
  • selectWindow
  • sendKeys
  • setSpeed
  • setWindowSize
  • store
  • storeAttribute
  • storeJson
  • storeText
  • storeTitle
  • storeValue
  • storeWindowHandle
  • storeXpathCount
  • submit
  • type
  • uncheck
  • verify
  • verifyChecked
  • verifyEditable
  • verifyElementPresent
  • verifyElementNotPresent
  • verifyNotChecked
  • verifyNotEditable
  • verifyNotSelectedValue
  • verifyNotText
  • verifySelectedLabel
  • verifySelectedValue
  • verifyText
  • verifyTitle
  • verifyValue
  • waitForElementEditable
  • waitForElementNotEditable
  • waitForElementNotPresent
  • waitForElementNotVisible
  • waitForElementPresent
  • waitForElementVisible
  • waitForText
  • webdriverAnswerOnVisiblePrompt
  • webdriverChooseCancelOnVisibleConfirmation
  • webdriverChooseOkOnVisibleConfirmation

Pandora FMS ドキュメント一覧に戻る

  • ja/documentation/pandorafms/technical_annexes/48_pfms_wux_selenium_3.txt
  • 最終更新: 2026/03/08 04:38
  • by junichi