通知を受け取る

UiPath Studio

UiPath Studio ガイド

セレクターについて

ユーザー インターフェイス内の特定のアクションを自動化するには、さまざまなウィンドウ、ボタン、ドロップダウン リストなどを操作する必要があります。UI 要素を識別する方法の 1 つとして、画面上の要素の位置を使用する方法がありますが、これは信頼性が低いことがあります。

より確実な操作を行えるように、UiPath Studio ではセレクターと呼ばれる機能を使用します。セレクターは、グラフィカル ユーザー インターフェイス要素とその親要素の属性を XML フラグメントの形で格納します。

ほとんどの場合、セレクターは Studio によって自動的に生成されます。特に、自動化対象のアプリケーションのユーザー インターフェイスが起動するたびに変わるものでなければ、生成されたセレクターをユーザーが編集する必要はありません。

しかし、一部の Web アプリケーションなど、ソフトウェア プログラムによっては、レイアウトが変わるものや一時的な値を保持する属性ノードを持つものがあります。UiPath Studio はこうした変化を予測することはできないため、場合によってはユーザーがいくつかのセレクターを手動で記述する必要があります。

セレクターは次の構造を持っています。

<node_1/><node_2/>...<node_N/>

最後のノードは対象となる GUI 要素を表し、それより前のノードはすべてその要素の親を表します。<node_1> は通常、ルートノードと呼ばれ、アプリケーションのトップ ウィンドウを表します。

各ノードには 1 つ以上の属性があり、選択したアプリケーションの特定の階層を正しく識別するのに役立ちます。

各ノードは、次の形式で表されます。 

<ui_system attr_name_1='attr_value_1' ... attr_name_N='attr_value_N'/>

すべての属性には値が割り当てられています。定数値を持つ属性を選択することが重要です。アプリケーションを起動するたびに属性の値が変わってしまう場合、セレクターは要素を正しく識別することができなくなります。

セレクターは、アクティビティの [プロパティ] パネルの [入力] > [ターゲット] > [セレクター] に生成されます。グラフィカル要素関連のアクティビティはすべてこのプロパティを持っています。

580

[セレクター エディター] ウィンドウでは、自動生成されたセレクターを表示して、そのセレクターとその属性を編集できます。このウィンドウを開くには、ワークフロー デザイナー パネルでアクティビティの本体にあるオプション ボタン Options button をクリックして [セレクターを編集] を選択します。

1202

これは、[プロパティ] パネルの [セレクター] フィールドの横にある省略記号ボタン image alt text を使用して行うこともできます。

609
OptionDescription
ValidateThe button shows the status of the selector by checking the validity of the selector definition and the visibility of the target element on the screen.
The Validate button has three states:
image alt text Selector is being validated
image alt text Valid selector
image alt text Invalid selector
image alt text Modified selector, revalidate

The button is correlated with UI Explorer validation states.
Indicate ElementIndicate a new UI element to replace the previous one.
RepairEnables you to re-indicate the same target UI element and repair the selector. This operation does not completely replace the previous selector. The button is available only when the selector is invalid.
HighlightBrings the target element in the foreground. The highlight stays on until the option is disabled with a click. The button is enabled only if the selector is valid.
Edit AttributesContains all the application components needed to identify the target application (a window, a button etc.). This section is editable.
Edit SelectorHolds the actual selector. This section is editable.
Open in UI ExplorerLaunches the UI Explorer. The option is enabled only for valid selectors.

📘

注:

Studio とターゲット アプリケーションを異なる権限で起動した場合、セレクターが動作しないことがあります。これら 2 つのアプリケーションは常に同じ権限で開くことをお勧めします。

サポートされているタグと属性

下表は、セレクターの作成に使用するタグおよび属性と、サポートされているセレクターの機能を示したものです。

📘

注:

Java アプリケーション用に生成される複数の WND タグを含むセレクターは、イベントの監視に使用できません。

WND

AttributeFuzzyRegExCase-Sensitive
appcheck_markcheck_markcheck_mark
clscheck_markcheck_markcheck_mark
titlecheck_markcheck_markcheck_mark
aanamecheck_markcheck_markcheck_mark
ctrlname (WinForms)check_markcheck_markcheck_mark
ctrlid (WinForms)check_markcheck_markcheck_mark
idxno_rightno_rightno_right
tidno_rightno_rightno_right
pidno_rightno_rightno_right
isremoteappno_rightno_rightno_right
aastatecheck_markcheck_markcheck_mark
sapClient (SAP)check_markcheck_markcheck_mark
sapLanguage (SAP)check_markcheck_markcheck_mark
sapProgram (SAP)check_markcheck_markcheck_mark
sapScreen (SAP)no_rightno_rightno_right
sapSession (SAP)no_rightno_rightno_right
sapSysName (SAP)check_markcheck_markcheck_mark
sapSysNumber (SAP)no_rightno_rightno_right
sapSysSessionId (SAP)check_markcheck_markcheck_mark
sapTransaction (SAP)check_markcheck_markcheck_mark
sapUser (SAP)check_markcheck_markcheck_mark

HTML

AttributeFuzzyRegExCase-Sensitive
urlcheck_markcheck_markcheck_mark
htmlwindownamecheck_markcheck_markcheck_mark
titlecheck_markcheck_markcheck_mark
classcheck_markcheck_markcheck_mark
appno_rightno_rightno_right
idxno_rightno_rightno_right
pidno_rightno_rightno_right
tidno_rightno_rightno_right
excludehwndno_rightno_rightno_right
bsid (Browser Session ID)no_rightno_rightno_right
isremoteappno_rightno_rightno_right

WEBCTRL

tag および idx 属性は文字列値を使用します。その他の WEBCTRL 属性は、すべて動的な値を取ります。

AttributeFuzzyRegExCase-Sensitive
tagno_rightno_rightno_right
idxcheck_markcheck_markcheck_mark
aanamecheck_markcheck_markcheck_mark
namecheck_markcheck_markcheck_mark
idcheck_markcheck_markcheck_mark
parentidcheck_markcheck_markcheck_mark
classcheck_markcheck_markcheck_mark
css-selectorno_rightno_rightno_right
innertextcheck_markcheck_markcheck_mark
visibleinnertextcheck_markcheck_markcheck_mark
isleafcheck_markcheck_markcheck_mark
parentclasscheck_markcheck_markcheck_mark
parentnamecheck_markcheck_markcheck_mark
srccheck_markcheck_markcheck_mark
hrefcheck_markcheck_markcheck_mark
tableColcheck_markcheck_markcheck_mark
tableRowcheck_markcheck_markcheck_mark
colNamecheck_markcheck_markcheck_mark
rowNamecheck_markcheck_markcheck_mark
aria-labelcheck_markcheck_markcheck_mark
aria-labelledbycheck_markcheck_markcheck_mark

Ctrl

AttributeFuzzyRegExCase-Sensitive
rolecheck_markcheck_markcheck_mark
namecheck_markcheck_markcheck_mark
automationidcheck_markcheck_markcheck_mark
labeledbycheck_markcheck_markcheck_mark
aastatecheck_markcheck_markcheck_mark
virtualnamecheck_markcheck_markcheck_mark
textcheck_markcheck_markcheck_mark
rowNamecheck_markcheck_markcheck_mark
idxno_rightno_rightno_right

UIA

AttributeFuzzyRegExCase-Sensitive
accelkey (Accelerator Key)check_markcheck_markcheck_mark
acskey (Access Key)check_markcheck_markcheck_mark
automationidcheck_markcheck_markcheck_mark
clscheck_markcheck_markcheck_mark
helpTextcheck_markcheck_markcheck_mark
legacyAccHelp (Legacy Accessible Help)check_markcheck_markcheck_mark
enabledcheck_markcheck_markcheck_mark
kbfocus (Is Keyboard Focusable)check_markcheck_markcheck_mark
ispwd (Is Password)check_markcheck_markcheck_mark
itemstatuscheck_markcheck_markcheck_mark
itemtypecheck_markcheck_markcheck_mark
rtid (Runtime ID)check_markcheck_markcheck_mark
rolecheck_markcheck_markcheck_mark
namecheck_markcheck_markcheck_mark
pidcheck_markcheck_markcheck_mark
tableRowno_rightno_rightno_right
tableColno_rightno_rightno_right
rowNamecheck_markcheck_markcheck_mark
colNamecheck_markcheck_markcheck_mark
idxno_rightno_rightno_right

Java

AttributeFuzzyRegExCase-Sensitive
rolecheck_markcheck_markcheck_mark
namecheck_markcheck_markcheck_mark
virtualnamecheck_markcheck_markcheck_mark
javastatecheck_markcheck_markcheck_mark
tableRowno_rightno_rightno_right
tableColno_rightno_rightno_right
rowNamecheck_markcheck_markcheck_mark
colNamecheck_markcheck_markcheck_mark
idxno_rightno_rightno_right

SAP

AttributeFuzzyRegExCase-Sensitive
idcheck_markcheck_markcheck_mark
leafid
This attribute is not exposed in the Attribute panel because it is mutual-exclusive with the id attribute. It can be added manually.
check_markcheck_markcheck_mark
tableRowno_rightno_rightno_right
tableColno_rightno_rightno_right
colNamecheck_markcheck_markcheck_mark
relpathcheck_markcheck_markcheck_mark
itemIdcheck_markcheck_markcheck_mark

Silverlight

Silverlight タグは、あいまい正規表現大文字と小文字を区別する機能をサポートしない点にご注意ください。

5 か月前に更新


セレクターについて


改善の提案は、API リファレンスのページでは制限されています

改善を提案できるのは Markdown の本文コンテンツのみであり、API 仕様に行うことはできません。