studio
latest
false
- 基本情報
- セットアップと構成
- オートメーション プロジェクト
- 依存関係
- ワークフローの種類
- 制御フロー
- ファイルの比較
- オートメーションのベスト プラクティス
- ソース管理との連携
- デバッグ
- ログ
- 診断ツール
- ワークフロー アナライザー
- ワークフロー アナライザーについて
- ST-DBP-002 - 多数の引数
- ST-DBP-003 - 空の catch ブロック
- ST-DBP-007 - 複数のフローチャートレイヤー
- ST-DPB-010 - [ワークフロー] または [テスト ケース] の複数のインスタンス
- ST-DBP-020 - 未定義の出力プロパティ
- ST-DBP-021 - ハードコードされたタイムアウト
- ST-DBP-023 - 空のワークフロー
- ST-DBP-024 - 永続性アクティビティの確認
- ST-DBP-025 - 変数のシリアル化の前提条件
- ST-DBP-026 - [待機] アクティビティの使用
- ST-DBP-027 - Persistence のベスト プラクティス
- ST-DBP-028 - 引数のシリアル化の前提条件
- ST-USG-005 - ハードコードされたアクティビティ引数
- ST-USG-009 - 未使用の変数
- ST-USG-010 - 未使用の依存関係
- ST-USG-014 - パッケージの制限
- ST-USG-017 - パラメーターの修飾子が無効
- ST-USG-020 - 最小ログ メッセージ
- ST-USG-024 - 未使用で保存されたままの値
- ST-USG-025 - 保存した値の誤用
- ST-USG-026 - アクティビティの制限
- ST-USG-027 - 必要なパッケージ
- ST-USG-028 - ファイル テンプレートの呼び出しの制限
- ST-USG-027 - 必須のタグ
- ST-USG-034 - Automation Hub URL
- 変数
- 引数
- インポートされた名前空間
- コード化されたオートメーション
- トリガーベースの有人オートメーション
- レコーディング
- UI 要素
- セレクター
- オブジェクト リポジトリ
- データ スクレイピング
- 画像とテキストの自動化
- Citrix テクノロジの自動化
- RDP の自動化
- VMware Horizon の自動化
- Salesforce の操作の自動化
- SAP のオートメーション
- macOS の UI Automation
- ScreenScrapeJavaSupport ツール
- Webdriver プロトコル
- 拡張機能
- 拡張機能について
- SetupExtensions ツール
- Safari 向けの拡張機能
- VMware Horizon 向け拡張機能
- Amazon WorkSpaces 拡張機能
- SAP Solution Manager プラグイン
- Excel アドイン
- Studio でのテスト
- トラブルシューティング
重要 :
このコンテンツの一部は機械翻訳によって処理されており、完全な翻訳を保証するものではありません。
新しいコンテンツの翻訳は、およそ 1 ~ 2 週間で公開されます。

Studio ガイド
最終更新日時 2025年5月29日
インポートしたライブラリ プロジェクトをコード化されたオートメーションで使用する
このチュートリアルでは、インポートしたライブラリ プロジェクトから取得したオブジェクトをコード化されたオートメーション内で使用する方法について説明します。この例では、インポートしたライブラリ プロジェクトから取得したオブジェクト リポジトリの要素とワークフローを使用する方法を示します。指定のシナリオでは、ACME Web サイトを自動化して、学生のスコア カードに必要事項を入力し、それをデータベースに追加します。
- UI Automation アクティビティ パッケージのバージョン 23.10.13 以降をインストールします。
注: 使用しているメジャー バージョンに対応する最新のマイナー バージョンを使用することをお勧めします。たとえば、メジャー バージョン 23.10 のアクティビティ パッケージを使用している場合は、利用可能な最新のマイナー バージョン (
23.10.x
) にアップグレードすることをお勧めします。 - ACME ライブラリのサンプルをパブリッシュし、作業中のプロジェクトにインストールします。
ACME アプリの自動化 (厳密には学生のスコア カードへの入力) に不可欠な UI 要素を格納するライブラリ プロジェクトを作成します。さらに、ライブラリ プロジェクト内にローコード (
.xaml
) またはコード化されたワークフロー (.cs
) を作成します。これは、後で別のコード化されたオートメーション内で使用するものです。
AcmeLibrary
という名前のライブラリ プロジェクトを作成します。- [オブジェクト リポジトリ] と [記述子] セクション内で使用する、すべての UI 要素をキャプチャします。
- [ファイル] グループから、新しいコード化されたワークフローを作成します。
この手順は、別のプロジェクトにライブラリをインポートするときに、コード化されたオートメーション内のオブジェクト リポジトリにアクセスできるようにするために重要です。
- Main ローコード ワークフローの名前を
Send message box
に変更し、[メッセージ ボックス] アクティビティを、「You've added a new score card for a student in Acme. (ACME の学生用に新しいスコア カードを追加しました。)」というテキストと共に追加します。注: チュートリアルで説明されている手順に従って、[メッセージ ボックス] アクティビティをコード化されたワークフローとして再作成することもできます。 - ライブラリ プロジェクトを保存し、フィードにパブリッシュします。
このパブリッシュされたライブラリは、コード化されたオートメーション内の別のプロジェクトにインストールして使用します。
ライブラリ プロジェクトの作成後、それを別のプロジェクトにインストールして、その再利用可能なアセット (オブジェクト リポジトリの要素やワークフローなど) を、それらがローコード (
.xaml
) かコード化 (.cs
) かにかかわらず活用します。
Tip: When using UI Automation coded automation APIs, remember that the overloads with
IScreenDescriptor
or IElementDescriptor
are intended to work with Object Repository elements, while the overloads with TargetAnchorableModel
are meant for use with native selectors obtained through the UI Explorer. Visit UI Automation coded automation APIs to learn how to leverage selectors with UI Automation coded automation APIs.
- [ファイル] グループから、新しいコード化されたワークフローを作成します。
- [パッケージを管理] に移動し、以前に作成したライブラリ プロジェクトをインストールします。
- [ファイル] グループから、新しいワークフローを作成します。
- ワークフローに
notifyStudentScoreCardAdded
という名前を付けます。 - [アクティビティ] パネル、[インストール済み] セクションの順に移動します。
- インポートしたライブラリ プロジェクトの名前 (この例では
AcmeLibrary
) を検索します。 Send message box
アクティビティをnotifyStudentScoreCardAdded
内にドラッグ アンド ドロップします。これで、notifyStudentScoreCardAdded
の動作は、インポートしたライブラリ プロジェクトから取得したSend message box
ワークフローと同じになります。
- ワークフローに
- 読みやすくするために、インポートしたオブジェクト リポジトリ アプリケーションを変数として定義し、ワークフローの先頭に
using
ステートメントを適用できます。以下に例を示します。using app = <ProjectName>.ObjectRepository.Descriptors
この方法では、app.<AppName>.<ScreenName>.<UiElementName>
形式で記述子を簡単に呼び出すことができます。この例では、ACME オブジェクト リポジトリを次のように定義します。namespace UsingImportedLibraryProjects { using AcmeApp = AcmeLibrary.ObjectRepository.Descriptors;
namespace UsingImportedLibraryProjects { using AcmeApp = AcmeLibrary.ObjectRepository.Descriptors; - Now you can automate the given scenario within Acme. Start by opening the Acme login screen using the Open coded automation API.
[Workflow] public void Execute() { // 1.Open the Acme app on the Login screen var AcmeLoginScreen = uiAutomation.Open(AcmeApp.Acme.LoginScreen);
[Workflow] public void Execute() { // 1.Open the Acme app on the Login screen var AcmeLoginScreen = uiAutomation.Open(AcmeApp.Acme.LoginScreen); - Type in the necessary credentials for logging into Acme, using the TypeInto coded automation API.
// 2.Type in the necessary credentials AcmeLoginScreen.TypeInto(AcmeApp.Acme.LoginScreen.Email, "john.doe2023@uipath.com"); AcmeLoginScreen.TypeInto(AcmeApp.Acme.LoginScreen.Password, "12345678");
// 2.Type in the necessary credentials AcmeLoginScreen.TypeInto(AcmeApp.Acme.LoginScreen.Email, "john.doe2023@uipath.com"); AcmeLoginScreen.TypeInto(AcmeApp.Acme.LoginScreen.Password, "12345678"); - Use the Click coded automation API, along with a native selector, to click the Login button.
// 3.Use a native selector to click the Login button AcmeLoginScreen.Click(Target.FromSelector("<webctrl tag='BUTTON' type='submit'/>"));
// 3.Use a native selector to click the Login button AcmeLoginScreen.Click(Target.FromSelector("<webctrl tag='BUTTON' type='submit'/>")); - The login process takes you to the Dashboard screen in the Acme web application. Therefore, use the Attach coded automation API to focus on the new screen.
// 4. Focus on the Dashboard screen var DashboardScreen = uiAutomation.Attach(AcmeApp.Acme.Dashboard);
// 4. Focus on the Dashboard screen var DashboardScreen = uiAutomation.Attach(AcmeApp.Acme.Dashboard); - Select the Students entry on the website, using the Click coded automation API.
// 5. Click the Students entry DashboardScreen.Click(AcmeApp.Acme.Dashboard.Students);
// 5. Click the Students entry DashboardScreen.Click(AcmeApp.Acme.Dashboard.Students); - Select Score card to open the Students - Score Card form, using the Click coded automation API.
// 6. Click Score card, to start filling in a student score card DashboardScreen.Click(AcmeApp.Acme.Dashboard.Students.ScoreCard);
// 6. Click Score card, to start filling in a student score card DashboardScreen.Click(AcmeApp.Acme.Dashboard.Students.ScoreCard); - Focus on the Students - Score Card screen, using the Attach coded automation API.
// 7. Focus on the Score Card screen where you fill in the necessary information var ScoreCardScreen = uiAutomation.Attach(AcmeApp.Acme.StudentsScoreCard);
// 7. Focus on the Score Card screen where you fill in the necessary information var ScoreCardScreen = uiAutomation.Attach(AcmeApp.Acme.StudentsScoreCard); - Fill in half of the fields in the Students - Score Card form using the TypeInto coded automation API, and elements from the Object Repository.
ScoreCardScreen.TypeInto(AcmeApp.StudentsScoreCard.StudentEmail, "john.doe@uipath.com"); ScoreCardScreen.TypeInto(AcmeApp.Acme.StudentsScoreCard.FirstName, "John"); ScoreCardScreen.TypeInto(AcmeApp.Acme.StudentsScoreCard.LastName, "Doe"); ScoreCardScreen.TypeInto(AcmeApp.Acme.StudentsScoreCard.ParentEmail, "johnny.doe@uipath.com"); ScoreCardScreen.TypeInto(AcmeApp.Acme.StudentsScoreCard.Tuition, "Private");
ScoreCardScreen.TypeInto(AcmeApp.StudentsScoreCard.StudentEmail, "john.doe@uipath.com"); ScoreCardScreen.TypeInto(AcmeApp.Acme.StudentsScoreCard.FirstName, "John"); ScoreCardScreen.TypeInto(AcmeApp.Acme.StudentsScoreCard.LastName, "Doe"); ScoreCardScreen.TypeInto(AcmeApp.Acme.StudentsScoreCard.ParentEmail, "johnny.doe@uipath.com"); ScoreCardScreen.TypeInto(AcmeApp.Acme.StudentsScoreCard.Tuition, "Private"); - Fill in the rest of the fields in the form using the TypeInto coded automation API in combination with native selectors that you discover through the UI Explorer.
ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='mathematics' tag='INPUT' />"), "A"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='physics' tag='INPUT' />"), "B"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='biology' tag='INPUT' />"), "C"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='chemistry' tag='INPUT' />"), "A"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='geography' tag='INPUT' />"), "C"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='history' tag='INPUT' />"), "A"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='english' tag='INPUT' />"), "A"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='computer Science' tag='INPUT' />"), "C"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='professorComments' tag='INPUT' />"), "The student is doing okay, very hardworking and does its best");
ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='mathematics' tag='INPUT' />"), "A"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='physics' tag='INPUT' />"), "B"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='biology' tag='INPUT' />"), "C"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='chemistry' tag='INPUT' />"), "A"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='geography' tag='INPUT' />"), "C"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='history' tag='INPUT' />"), "A"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='english' tag='INPUT' />"), "A"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='computer Science' tag='INPUT' />"), "C"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='professorComments' tag='INPUT' />"), "The student is doing okay, very hardworking and does its best"); - Select Add score card details using the Click coded automation API.
// 10. Click the "Add score card details" button using an Object Repository descriptor ScoreCardScreen.Click(AcmeApp.Acme.StudentsScoreCard.AddScoreCardDetailsButton);
// 10. Click the "Add score card details" button using an Object Repository descriptor ScoreCardScreen.Click(AcmeApp.Acme.StudentsScoreCard.AddScoreCardDetailsButton); RunWorkflow()
メソッドを使用して、ライブラリ プロジェクトからインポートしたワークフローを呼び出します。このメソッドにプロジェクト内のワークフローのパスを指定します。// 11. Invoke imported workflow from library RunWorkflow("notifyStudentScoreCardAdded.xaml");
// 11. Invoke imported workflow from library RunWorkflow("notifyStudentScoreCardAdded.xaml");- Close the browser tabs you opened to automate the scenario, using the
Dispose()
coded automation API.// 12. Close the applications/browsers you opened, to finish he automation ScoreCardScreen.Dispose();
// 12. Close the applications/browsers you opened, to finish he automation ScoreCardScreen.Dispose();
To follow the steps and try out the tutorial yourself, see the following sample project: Using imported library projects in coded automations. The file contains the library project, as well.