- 概要
- UI Automation
- UI Automation アクティビティ パッケージについて
- UI Automation を使用して自動化されるアプリケーションと技術
- プロジェクトの対応 OS
- UI-ANA-016 - [ブラウザーを開く] に使用されている URL を検出
- UI-ANA-017 - [エラー発生時に実行を継続] の値が True
- UI-ANA-018 - OCR/画像関連のアクティビティのリスト
- UI-DBP-006 - コンテナーの使用
- UI-DBP-013 - Excel の自動化方法の誤用
- UI-DBP-030 - セレクター内での変数の使用禁止
- UI-DBP-031 - アクティビティの検証
- UI-PRR-001 - クリックをシミュレート
- UI-PRR-002 - 入力をシミュレート
- UI-PRR-003 - [アプリケーションを開く] の誤用
- UI-PRR-004 - ハードコードされた待機時間
- UI-REL-001 - セレクター内の大きいインデックス値
- UI-SEC-004 - メール アドレスのデータを含むセレクター
- UI-SEC-010 - アプリ/URL の制限
- UI-USG-011 - 許可されていない属性
- UX-SEC-010 - アプリ/URL の制限
- UX-DBP-029 - セキュリティで保護されていないパスワードの使用
- UI-PST-001 - [プロジェクト設定] の監査ログ レベル
- UiPath ブラウザー移行ツール
- クリッピング領域
- Computer Vision レコーダー
- Remote UI Automation design (Live authoring)
- アクティビティの索引
- アクティベート
- アンカー ベース
- ブラウザーにアタッチ
- ウィンドウにアタッチ
- ユーザー入力をブロック
- 吹き出し
- チェック
- クリック
- 画像をクリック
- 画像クリック トリガー
- OCR で検出したテキストをクリック
- テキストをクリック
- クリック トリガー
- アプリケーションを閉じる
- タブを閉じる
- ウィンドウを閉じる
- コンテキスト対応のアンカー
- 選択されたテキストをコピー
- 要素属性変更トリガー
- 要素の存在を確認
- 要素スコープ
- 要素ステート変更トリガー
- UI ツリーをエクスポート
- 構造化データを抽出
- 子要素を探す
- 要素を探す
- 画像を探す
- 一致する画像を探す
- OCR でテキスト位置を探す
- 相対要素を探す
- テキスト位置を探す
- アクティブ ウィンドウを取得
- 親要素を取得
- 属性を取得
- イベント情報を取得
- クリップボードから取得
- フル テキストを取得
- OCR でテキストを取得
- パスワードを取得
- 位置を取得
- ソース要素を取得
- テキストを取得
- 表示中のテキストを取得
- 前に戻る
- 次に進む
- ホームに移動
- Google Cloud Vision OCR
- ウィンドウを隠す
- 強調表示
- ホットキー トリガー
- ホバー
- 画像上でホバー
- OCR で検出したテキスト上でホバー
- テキスト上でホバー
- 画像の存在を確認
- 画面上で指定
- .NET コードを挿入
- JS スクリプトを挿入
- ActiveX メソッドを呼び出し
- キー操作トリガー
- 画像を読み込み
- ウィンドウを最大化
- Microsoft Azure ComputerVision OCR
- Microsoft OCR
- Microsoft Project Oxford Online OCR
- ウィンドウを最小化
- イベントを監視
- マウス トリガー
- ウィンドウを移動
- URL に移動
- OCR でテキストの存在を確認
- 要素が出現したとき
- 要素が消滅したとき
- 画像が出現したとき
- 画像が消滅したとき
- アプリケーションを開く
- ブラウザーを開く
- ブラウザーを更新
- ユーザー イベントを再生
- ウィンドウを復元
- 画像を保存
- 項目を選択
- 複数の項目を選択
- ホットキーを押下
- クリッピング領域を設定
- フォーカスを設定
- テキストを設定
- クリップボードに設定
- Web 属性を設定
- ウィンドウを表示
- プロセスを開始
- システム トリガー
- スクリーンショットを作成
- Tesseract OCR
- テキストの存在を確認
- ツールチップ
- 文字を入力
- SecureString で文字を入力
- フォアグラウンドを使用
- 属性を待つ
- 要素の消滅を待つ
- 画像の消滅を待つ
- アクセシビリティ チェック
- アプリケーション イベント トリガー
- ユーザー入力をブロック
- チェック/チェック解除
- アプリのステートを確認
- 要素を確認
- クリック
- クリック イベント トリガー
- ドラッグ アンド ドロップ
- 要素スコープ
- 表データを抽出
- 要素を探す
- 繰り返し (各 UI 要素)
- ブラウザーのデータを取得
- クリップボードを取得
- テキストを取得
- URL を取得
- URL に移動
- ステータス ウィンドウを非表示
- 強調表示
- ホバー
- JS スクリプトを挿入
- キーボード ショートカット
- キー押下イベント トリガー
- マウス スクロール
- ブラウザー内を移動
- 画像を保存
- 項目を選択
- ブラウザーのデータを設定
- クリップボードに設定
- CV サーバを設定
- ランタイム ブラウザーを設定
- フォーカスを設定
- プロジェクト設定を行う
- テキストを設定
- ステータス メッセージを表示
- ステータス ウィンドウを表示
- スクリーンショットを作成
- 文字を入力
- ユーザー入力のブロックを解除
- ウィンドウ操作
- UI Automation API を使用してブラウザー検索を実行し、結果を取得する
- Web の閲覧
- 画像を検索する
- 画像をクリックする
- イベントをトリガーおよび監視する
- ファイルを作成して上書きする
- HTML ページ: 情報を抽出して操作する
- ウィンドウの操作
- リスト項目の選択の自動化
- ウィンドウ要素を探して操作する
- テキスト操作の自動化を行う
- 画像を読み込んで処理する
- マウスでアクティブ化する操作を管理する
- アプリケーションランタイムの操作を自動化する
- ローカル アプリケーションの自動実行
- ブラウザーのナビゲーション
- Web オートメーション
- トリガー スコープの例
- DevExpress での UI Automation の有効化
- Computer Vision Local Server
- モバイル オートメーション
- ターミナル
開く
UI Automation のコード化されたオートメーション API で開く: UI 操作を自動化するときに使用するデスクトップ アプリケーションまたは Web ブラウザーを開きます。
UI 操作を自動化するときに使用するデスクトップ アプリケーションまたは Web ブラウザーを開きます。
この API を使用するには、uiAutomation.API() の形式で UI Automation サービスを呼び出します。例: uiAutomation.Open()
定義
名前空間: UiPath.UIAutomationNext.API.Contracts
アセンブリ: UiPath.UIAutomationNext.API.Contracts (UiPath.UIAutomationNext.API.Contracts dll 内)
オーバー ロード
| オーバーロード | 説明 |
|---|---|
Open(String, TargetAppOptions, String, String) | オブジェクト リポジトリの画面名で識別される、UI 操作の自動化で使用する特定のデスクトップ アプリケーションまたは Web ページを開きます。 |
Open(TargetAppModel, TargetAppOptions) | TargetAppModel オブジェクトで識別される、UI 操作の自動化で使用する特定のデスクトップ アプリケーションまたは Web ページを開きます。 |
Open(String, String, String, NAppOpenMode, NWindowResize, NInteractionMode) | オブジェクト リポジトリの画面名で識別される、UI 操作の自動化で使用する特定のデスクトップ アプリケーションまたは Web ページを開きます。同時に、アプリケーションまたは Web ページのその他のカスタマイズも行います。 |
Open(String, TargetAppOptions, String, String)
オブジェクト リポジトリの画面名で識別される、UI 操作の自動化で使用する特定のデスクトップ アプリケーションまたは Web ページを開きます。
Open(
string screenName,
TargetAppOptions targetAppOptions,
[string appName],
[string appVersion])
Open(
string screenName,
TargetAppOptions targetAppOptions,
[string appName],
[string appVersion])
screeName文字列: フォーカスする画面の名前を、オブジェクト リポジトリ内に記録した文字列で表したものです。
targetAppOptions: アプリケーションまたは Web ページにアタッチするための追加オプションと設定です。
* `Timeout Double` - Specify a number of seconds for which to wait for the activity to be executed before throwing an error. The default value is 30 seconds. When indicating a window in a Remote Desktop environment, the Timeout default setting is set to 60 seconds.
* `InteractionMode
NInteractionMode`:
+ `HardwareEvents` - Uses the hardware driver to perform the action. This is the slowest API, it cannot work in the background, but it is compatible with all desktop apps.
+ `Simulate` - Simulates the action using accessibility APIs. Recommended in browser automation, Java apps, or SAP. More reliable than Hardware Events. Sends all text in a single action. Works even if the target application is not in focus. Please test if your target application UI element supports this.
+ `DebuggerApi` - Performs actions using debugger APIs. Works only for Chromium elements. Sends all text in one go. Works even if target app is not in focus.
For more details, check out this [page](https://docs.uipath.com/studio/docs/chromium-api).
+ `WindowMessages` - Sends the mouse and keyboard input through Win32 messages. Recommended for desktop apps. Usually more reliable than Hardware Events.
Sends all text in a single action. Works even if target app is not in focus. Please test if your target application UI element supports this.
+ `Background` - Runs actions in the background. Tries to use either Simulate or Chromium API where possible, while complex APIs (image, native text) run as usual, in the foreground. It is highly recommended to use this API with the [Verify Execution](https://docs.uipath.com/activities/other/latest/user-guide/project-settings-ui-automation) feature.
* `OpenMode NAppOpenMode` - choose when to open the app:
+ `Never` (never open the application)
+ `IfNotOpen` (open only if the application is closed, this is the default selection, only works if `FilePath` or `URL`
are provided)
+ `Always` (open another instance of the application even if one is already open, only works if `FilePath` or `URL` are provided)
* `WindowResize NWindowResize` - choose the size of the window:
+ `None`
+ `Maximize`
+ `Restore`
+ `Minimize`
* `UserDataFolderMode
BrowserUserDataFolderMode` - The `UserDataFolderMode` you want to set. It is used to start the browser with a specific user data folder.
+ `Automatic` - Picture In Picture mode uses a different folder than the default mode, automatically generated if `UserDataFolderPath` is not set.
+ `DefaultFolder` - Uses the default browser folder, no matter if it runs in the main or PIP session.
+ `CustomFolder` - Uses the folder specified in `UserDataFolderPath` or an auto generated path if `UserDataFolderPath` is not set.
* `UserDataFolderPath String` - The user data folder that the browser uses. Defaults to `%LocalAppData%\UiPath\PIP Browser
Profiles\BrowserType` if not set.
* `IsIncognito Boolean` - input `True` if you want to open the browser in incognito mode. By default it's set to `False`.
* `WebDriverMode NWebDriverMode` -
Indicates how the WebDriver is used when opening a new browser session. The following options are available:
+ `Disabled` - Disables the use of
WebDriver.
+ `WithGUI` - The GUI of the browser is displayed.
+ `Headless` - The browser is launched silently, with no GUI.
* `Timeout Double` - Specify a number of seconds for which to wait for the activity to be executed before throwing an error. The default value is 30 seconds. When indicating a window in a Remote Desktop environment, the Timeout default setting is set to 60 seconds.
* `InteractionMode
NInteractionMode`:
+ `HardwareEvents` - Uses the hardware driver to perform the action. This is the slowest API, it cannot work in the background, but it is compatible with all desktop apps.
+ `Simulate` - Simulates the action using accessibility APIs. Recommended in browser automation, Java apps, or SAP. More reliable than Hardware Events. Sends all text in a single action. Works even if the target application is not in focus. Please test if your target application UI element supports this.
+ `DebuggerApi` - Performs actions using debugger APIs. Works only for Chromium elements. Sends all text in one go. Works even if target app is not in focus.
For more details, check out this [page](https://docs.uipath.com/ja/studio/docs/chromium-api).
+ `WindowMessages` - Sends the mouse and keyboard input through Win32 messages. Recommended for desktop apps. Usually more reliable than Hardware Events.
Sends all text in a single action. Works even if target app is not in focus. Please test if your target application UI element supports this.
+ `Background` - Runs actions in the background. Tries to use either Simulate or Chromium API where possible, while complex APIs (image, native text) run as usual, in the foreground. It is highly recommended to use this API with the [Verify Execution](https://docs.uipath.com/ja/activities/other/latest/user-guide/project-settings-ui-automation) feature.
* `OpenMode NAppOpenMode` - choose when to open the app:
+ `Never` (never open the application)
+ `IfNotOpen` (open only if the application is closed, this is the default selection, only works if `FilePath` or `URL`
are provided)
+ `Always` (open another instance of the application even if one is already open, only works if `FilePath` or `URL` are provided)
* `WindowResize NWindowResize` - choose the size of the window:
+ `None`
+ `Maximize`
+ `Restore`
+ `Minimize`
* `UserDataFolderMode
BrowserUserDataFolderMode` - The `UserDataFolderMode` you want to set. It is used to start the browser with a specific user data folder.
+ `Automatic` - Picture In Picture mode uses a different folder than the default mode, automatically generated if `UserDataFolderPath` is not set.
+ `DefaultFolder` - Uses the default browser folder, no matter if it runs in the main or PIP session.
+ `CustomFolder` - Uses the folder specified in `UserDataFolderPath` or an auto generated path if `UserDataFolderPath` is not set.
* `UserDataFolderPath String` - The user data folder that the browser uses. Defaults to `%LocalAppData%\UiPath\PIP Browser
Profiles\BrowserType` if not set.
* `IsIncognito Boolean` - input `True` if you want to open the browser in incognito mode. By default it's set to `False`.
* `WebDriverMode NWebDriverMode` -
Indicates how the WebDriver is used when opening a new browser session. The following options are available:
+ `Disabled` - Disables the use of
WebDriver.
+ `WithGUI` - The GUI of the browser is displayed.
+ `Headless` - The browser is launched silently, with no GUI.
appName文字列: アタッチするアプリケーションの名前です。このパラメーターはデスクトップ アプリケーションに適用できます。
appVersion文字列: アタッチ先のアプリケーションのバージョンです。このパラメーターはデスクトップ アプリケーションに適用できます。
Open(TargetAppModel, TargetAppOptions)
TargetAppModel オブジェクトで識別される、UI 操作の自動化で使用する特定のデスクトップ アプリケーションまたは Web ページを開きます。
Open(
TargetAppModel targetApp,
[TargetAppOptions targetAppOptions])
Open(
TargetAppModel targetApp,
[TargetAppOptions targetAppOptions])
targetApp TargetAppModel: 添付先のアプリケーションまたは Web ページです。アプリケーションに関する情報を提供する TargetAppModel 型のオブジェクトです。
* `Selector` - An XML fragment that stores the attributes of a user interface element.
* `FilePath` - If the application is not a web browser, specifies the full path of the executable file to open.
* `Arguments` - If the application is not a web browser, you can specify parameters to pass to the target application at startup.
* `Url`
- If the application is a web browser, specifies the URL of the web
page to open.
* `Title` - The title of the application or browser.
* `Selector` - An XML fragment that stores the attributes of a user interface element.
* `FilePath` - If the application is not a web browser, specifies the full path of the executable file to open.
* `Arguments` - If the application is not a web browser, you can specify parameters to pass to the target application at startup.
* `Url`
- If the application is a web browser, specifies the URL of the web
page to open.
* `Title` - The title of the application or browser.
targetAppOptions: アプリケーションまたは Web ページにアタッチするための追加オプションと設定です。
* `Timeout Double` - Specify a number of seconds for which to wait for the activity to be executed before throwing an error. The default value is 30 seconds. When indicating a window in a Remote Desktop environment, the Timeout default setting is set to 60 seconds.
* `InteractionMode NInteractionMode`:
+ `HardwareEvents` - Uses the hardware driver to perform the action. This is the slowest API, it cannot work in the background, but it is compatible with all desktop apps.
+ `Simulate` - Simulates the action using accessibility APIs. Recommended in browser automation, Java apps, or SAP. More reliable than Hardware Events. Sends all text in a single action. Works even if the target application is not in focus. Please test if your target application UI element supports this.
+ `DebuggerApi` - Performs actions using debugger APIs. Works only for Chromium elements. Sends all text in one go. Works even if target app is not in focus.
For more details, check out this [page](https://docs.uipath.com/studio/docs/chromium-api).
+ `WindowMessages` - Sends the mouse and keyboard input through Win32 messages. Recommended for desktop apps. Usually more reliable than Hardware Events.
Sends all text in a single action. Works even if target app is not in focus. Please test if your target application UI element supports this.
+ `Background` - Runs actions in the background. Tries to use either Simulate or Chromium API where possible, while complex APIs (image, native text) run as usual, in the foreground. It is highly recommended to use this API with the [Verify Execution](https://docs.uipath.com/activities/other/latest/user-guide/project-settings-ui-automation) feature.
* `OpenMode NAppOpenMode` - choose when to open the app:
+ `Never` (never open the application)
+ `IfNotOpen` (open only if the application is closed, this is the default selection, only works if `FilePath` or `URL` are provided)
+ `Always` (open another instance of the application even if one is already open, only works if `FilePath` or `URL` are provided)
* `WindowResize NWindowResize` - choose the size of the window:
+ `None`
+ `Maximize`
+ `Restore`
+ `Minimize`
* `UserDataFolderMode BrowserUserDataFolderMode`
- The `UserDataFolderMode` you want to set. It is
used to start the browser with a specific user data folder.
+ `Automatic` - Picture In Picture mode uses a different folder than the default mode, automatically generated if `UserDataFolderPath` is not set.
+ `DefaultFolder` - Uses the default browser folder, no matter if it runs in the main or PIP session.
+ `CustomFolder` - Uses the folder specified in `UserDataFolderPath` or an auto generated path if `UserDataFolderPath` is not set.
* `UserDataFolderPath String` - The user data folder that the browser uses. Defaults to `%LocalAppData%\UiPath\PIP Browser
Profiles\BrowserType` if not set.
* `IsIncognito Boolean` - input `True` if you want to open the browser in incognito mode. By default it's set to `False`.
* `WebDriverMode NWebDriverMode` - Indicates how the WebDriver is used when opening a new browser session. The following options are available:
+ `Disabled` - Disables the use of
WebDriver.
+ `WithGUI` - The GUI of the browser is displayed.
+ `Headless` - The browser is launched silently, with no GUI.
* `Timeout Double` - Specify a number of seconds for which to wait for the activity to be executed before throwing an error. The default value is 30 seconds. When indicating a window in a Remote Desktop environment, the Timeout default setting is set to 60 seconds.
* `InteractionMode NInteractionMode`:
+ `HardwareEvents` - Uses the hardware driver to perform the action. This is the slowest API, it cannot work in the background, but it is compatible with all desktop apps.
+ `Simulate` - Simulates the action using accessibility APIs. Recommended in browser automation, Java apps, or SAP. More reliable than Hardware Events. Sends all text in a single action. Works even if the target application is not in focus. Please test if your target application UI element supports this.
+ `DebuggerApi` - Performs actions using debugger APIs. Works only for Chromium elements. Sends all text in one go. Works even if target app is not in focus.
For more details, check out this [page](https://docs.uipath.com/ja/studio/docs/chromium-api).
+ `WindowMessages` - Sends the mouse and keyboard input through Win32 messages. Recommended for desktop apps. Usually more reliable than Hardware Events.
Sends all text in a single action. Works even if target app is not in focus. Please test if your target application UI element supports this.
+ `Background` - Runs actions in the background. Tries to use either Simulate or Chromium API where possible, while complex APIs (image, native text) run as usual, in the foreground. It is highly recommended to use this API with the [Verify Execution](https://docs.uipath.com/ja/activities/other/latest/user-guide/project-settings-ui-automation) feature.
* `OpenMode NAppOpenMode` - choose when to open the app:
+ `Never` (never open the application)
+ `IfNotOpen` (open only if the application is closed, this is the default selection, only works if `FilePath` or `URL` are provided)
+ `Always` (open another instance of the application even if one is already open, only works if `FilePath` or `URL` are provided)
* `WindowResize NWindowResize` - choose the size of the window:
+ `None`
+ `Maximize`
+ `Restore`
+ `Minimize`
* `UserDataFolderMode BrowserUserDataFolderMode`
- The `UserDataFolderMode` you want to set. It is
used to start the browser with a specific user data folder.
+ `Automatic` - Picture In Picture mode uses a different folder than the default mode, automatically generated if `UserDataFolderPath` is not set.
+ `DefaultFolder` - Uses the default browser folder, no matter if it runs in the main or PIP session.
+ `CustomFolder` - Uses the folder specified in `UserDataFolderPath` or an auto generated path if `UserDataFolderPath` is not set.
* `UserDataFolderPath String` - The user data folder that the browser uses. Defaults to `%LocalAppData%\UiPath\PIP Browser
Profiles\BrowserType` if not set.
* `IsIncognito Boolean` - input `True` if you want to open the browser in incognito mode. By default it's set to `False`.
* `WebDriverMode NWebDriverMode` - Indicates how the WebDriver is used when opening a new browser session. The following options are available:
+ `Disabled` - Disables the use of
WebDriver.
+ `WithGUI` - The GUI of the browser is displayed.
+ `Headless` - The browser is launched silently, with no GUI.
Open(String, String, String, NAppOpenMode, NWindowResize, NInteractionMode)
オブジェクト リポジトリの画面名で識別される、UI 操作の自動化で使用する特定のデスクトップ アプリケーションまたは Web ページを開きます。同時に、アプリケーションまたは Web ページのその他のカスタマイズも行います。
Open(
string screenName,
[string appName],
[string appVersion],
[NAppOpenMode openMode],
[NWindowResize windowResize],
[NInteractionMode interactionMode])
Open(
string screenName,
[string appName],
[string appVersion],
[NAppOpenMode openMode],
[NWindowResize windowResize],
[NInteractionMode interactionMode])
screeName文字列: フォーカスする画面の名前を、オブジェクト リポジトリ内に記録した文字列で表したものです。
appName文字列: アタッチするアプリケーションの名前です。このパラメーターはデスクトップ アプリケーションに適用できます。
appVersion文字列: アタッチ先のアプリケーションのバージョンです。このパラメーターはデスクトップ アプリケーションに適用できます。
openMode NAppOpenMode: オートメーションの実行対象のアプリケーションを開くタイミングを選択します。
* `Never` (never open the application)
* `IfNotOpen` (open only if the application is closed, this is the default selection, only works if the `Url` parameter is configured)
* `Always` - (open another instance of the application even if one is already open, only works if the `Url`
parameter is configured).
* `Never` (never open the application)
* `IfNotOpen` (open only if the application is closed, this is the default selection, only works if the `Url` parameter is configured)
* `Always` - (open another instance of the application even if one is already open, only works if the `Url`
parameter is configured).
NWindowResize: ウィンドウのサイズを選択します。
* `None`
* `Maximize`
* `Restore`
* `Minimize`
* `None`
* `Maximize`
* `Restore`
* `Minimize`
NInteractionMode: 対象のアプリケーションと対話するためにロボットが使用する API を選択します。
* `HardwareEvents` - Uses the hardware driver to perform the action. This is the slowest API, it cannot work in the background, but it is compatible with all desktop apps.
* `Simulate` - Simulates the action using accessibility
APIs. Recommended in browser automation, Java apps, or SAP. More reliable than Hardware Events. Sends all text in a single action.
Works even if the target application is not in focus. Please test if your target application UI element supports this.
* `DebuggerApi` - Performs actions using debugger APIs.
Works only for Chromium elements. Sends all text in one go. Works even if target app is not in focus. For more details, check out this [page](https://docs.uipath.com/studio/docs/chromium-api).
* `WindowMessages` - Sends the mouse and keyboard input through Win32 messages. Recommended for desktop apps. Usually more reliable than Hardware Events. Sends all text in a single action.
Works even if target app is not in focus. Please test if your target application UI element supports this.
* `Background` - Runs actions in the background. Tries to use either Simulate or Chromium API where possible, while complex
APIs (image, native text) run as usual, in the foreground. It is highly recommended to use this API with the [Verify Execution](https://docs.uipath.com/activities/other/latest/user-guide/project-settings-ui-automation) feature.
* `HardwareEvents` - Uses the hardware driver to perform the action. This is the slowest API, it cannot work in the background, but it is compatible with all desktop apps.
* `Simulate` - Simulates the action using accessibility
APIs. Recommended in browser automation, Java apps, or SAP. More reliable than Hardware Events. Sends all text in a single action.
Works even if the target application is not in focus. Please test if your target application UI element supports this.
* `DebuggerApi` - Performs actions using debugger APIs.
Works only for Chromium elements. Sends all text in one go. Works even if target app is not in focus. For more details, check out this [page](https://docs.uipath.com/ja/studio/docs/chromium-api).
* `WindowMessages` - Sends the mouse and keyboard input through Win32 messages. Recommended for desktop apps. Usually more reliable than Hardware Events. Sends all text in a single action.
Works even if target app is not in focus. Please test if your target application UI element supports this.
* `Background` - Runs actions in the background. Tries to use either Simulate or Chromium API where possible, while complex
APIs (image, native text) run as usual, in the foreground. It is highly recommended to use this API with the [Verify Execution](https://docs.uipath.com/ja/activities/other/latest/user-guide/project-settings-ui-automation) feature.
WebDriverMode をヘッドレスとして実行する
ヘッドレス構成で WebDriverMode を操作するには、以下の手順に従ってください。
まず、画面の変数を定義します。uiAutomation.Open 関数を使用して、任意のブラウザー (この例では Edge) で新しいアプリケーションを開きます。その後、オーバーロードで Options クラスを使用して特定のブラウザー オプションを指定します。これらのオプションのうち、webDriverMode を NWebDriverMode.Headless に設定します。
対応するコードは以下のようになります。
var screen = uiAutomation.Open(Descriptors.NewApplication.Edge, Options.AppOpen().WithBrowserOptions(webDriverMode: NWebDriverMode.Headless));
var screen = uiAutomation.Open(Descriptors.NewApplication.Edge, Options.AppOpen().WithBrowserOptions(webDriverMode: NWebDriverMode.Headless));
このコードは、WebDriver をヘッドレス モードに設定し、ブラウザーを開いて表示しなくてもそのブラウザーを自動化できるようにします。