For example assume there is 5 radio buttons and you have to click on last radio button mean 5th one, follow the below process.
→ Take an assign activity and create a Count Variable with Int datatype. And initialize the Count as 1.
- Assign -> Count = 1
→ Use the for each Ui element activity and indicate the radio buttons. Output - CurrentElement
→ Inside For each Ui element activity insert the If condition to check the Count.
- Condition -> Count = 5
→ In then block insert the click activity and pass the CurrentElement in the Input Element option of the properties in click activity.
→ Don’t give any activity inside the else block.
→ After If condition take an assign activity, to increment the Count.
- Assign -> Count = Count+1
Check the below workflow for better understanding,
First use Extract Datatable activity to extract the structured vertical radio button as a datatable. Then the output of Extract Datatable activity is Extract_dt variable.
→ Then take the Row count of Extract_dt and store in a Variable called Count.
→ Use the for each Ui element activity and indicate the radio buttons. Output - CurrentElement
→ Inside For each Ui element activity insert the If condition to check the Count.
- Condition -> Count = 1
→ In then block insert the click activity and pass the CurrentElement in the Input Element option of the properties in click activity.
→ Don’t give any activity inside the else block.
→ After If condition take an assign activity, to increment the Count.
- Assign -> Count = Count-1
The above process is dynamic we just take the count from the datatable rows count, if the radio button count changes it will work.
繰り返し回数は、画面要素から動的に決定されて、プロパティのどこに反映されるかよく分かりません。
一例として、下記サイトの中央に縦に並んでいるボタンをこのFor Each UI Element アクティビティを使って上から順番にクリックするサンプルプログラムを作成お願いできないでしょうか。
繰り返し回数がプロパティのどこの変数に設定されるかと、プログラマがこの変数を作成する必要があるのかないのか(いわゆる暗黙変数かどうか)も併せてご教示ください。
いただいた画像はすべてのUI Elements をクリックする事例でしょうか?
最後のボタンだけをクリックする場合は、おそらくUI Elements Collectionを編集する必要があると思いますが、いただいた画像ではその方法が分からないので、編集方法が分かる画像を提供お願いできないでしょうか?
もしフィルターを設定する必要があれば、その方法をご教示ください。
私の方でも、サンプルプログラムを作成してみました。
Yoichi様の案だと、UI Element変数「現在の要素」に繰り返しを始める際の、最初のセレクタ情報を入れる個所がないような気がしますが、どこで入れているのでしょうか?For Each UI Element アクティビティのプロパティを探しましたが、分かりませんでした。私案ですと最初のセレクタ情報を入れるためにダミーのクリックが必要な気がいたしました。(添付画像参照)
画像だと正確な情報が伝わりませので、WFをUploadしていただけないでしょうか。