Webサイトで、新しく開かれたタブの操作について

UiPath StudioXを使用しております。

Edgeでサイトから画像をダウンロードしたいです。
(社内システムのためこちらで共有ができないのですが、、)

そのサイトは以下のような仕様になっており
ページA・BのURLは固定、ページCのURLは変動的です。

  1. ページAのボタンaをクリックすると、新しいタブでページBが開かれる
  2. ページBのボタンbをクリックすると、新しいタブでページCが開かれる
  3. ページCのボタンcをクリックすると、ダウンロードが開始する

ページBのボタンb・ページCのボタンcをそれぞれクリックしたいのですが
「クリック」アクティビティのときにページAに戻ってしまいます。
「キーボードショートカット」アクティビティでCtrl+Tabを試してみましたが、
同様に戻ってしまいました。

新しく開かれたタブで操作をしたい場合、どのようにしたらよいでしょうか?

こんにちは

ページAとページBとで例えばセレクターのトップレベルのTitle属性は同じでしょうか?
もし異なるなら、Windowセレクターを適切に設定すれば、意図したページでの操作になると思いますが、いかがでしょうか?(Titleが同じでURLが異なるなら、URL属性で指定する手もあるかもしれません)

image

Hi @nynyny
To work with Page A
=> Use the “Open Browser” activity to navigate to the URL of page A.
=> Use a “Click” activity to click button a on page A, which opens page B in a new tab.

Now, to work with the newly opened tab (page B):
=> Use the “Attach Browser” activity and indicate the browser window that corresponds to the newly opened tab (page B). You may need to indicate the browser window by its title or URL.
=> Inside the “Attach Browser” activity, use a “Click” activity to click button b on page B, which opens page C in a new tab.

Finally, to work with the tab containing page C:
=> Again, use the “Attach Browser” activity to indicate the browser window that corresponds to the newly opened tab (page C).
=> Inside this “Attach Browser” activity, use a “Click” activity to click button c on page C to start the downloading process.

By using the “Attach Browser” activity, you can specify which tab or window to interact with, and this should help you perform operations on the newly opened tabs without being sent back to page A. Make sure to use selectors that accurately identify the elements on each page to ensure precise interaction.

Hope it helps!!

@Yoichi
返信ありがとうございます!

ページAとページBのTitle属性は異なりページBのタイトルは『データ出力』です。
ページBのボタンbの「クリック」アクティビティのウィンドウセレクターは
<html app='msedge.exe' htmlwindowname='dataOutput' title='データ出力' />
となっておりますが、ページAに戻ってしまっております。

@Parvathy
返信ありがとうございます!

“Attach Browser” アクティビティが無いのですが、
何かパッケージをインストールすることで使用できますでしょうか?

こんにちは

他のパラメーターがどうなっているかも確認したいですが、ちょっと難しそうですね。
簡易的には、もう一つアプリケーションブラウザを使用アクティビティを追加して(入れ子にしても可)ページBを指定、念のためプロパティパネルのウインドウアタッチモードをSingleWindowにした上で、ページBのボタンクリックを追加すれば、動作すると思います。

@nynyny

Attach Browser is an Classic activity. You can enable that clicking click on Classic in Filter option.

image

Regards,

@Yoichi
アプリケーションブラウザを入れ子にし、ウィンドウアタッチモードを「単一ウィンドウ」にしたところ動作しました!
ありがとうございました!

1 Like

@Parvathy
表示しているのですが無いので、StudioXでは使用できないのかもしれないです。。
アドバイスいただきありがとうございました!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.