cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Masanori
Regular Visitor

"Save File As" failed when plural Chrome running

I made a following PAD flow :

  Press button on web page (to download a file, Browser automation)

  Populate text field in window (full path of save file, "save file as" dialog, UI automation)

I'm starting the flow by launching new Chrome instance, and all actions worked well.

I succeeded in saveing the downloaded file.

 

But, if some other Chrome instance (A) exists before runnig the flow, "Populate text field in window" action fails.

The Chrome window (A) activated and PAD fails to find the text field.

How can I fix this probrem?

 

Power Automate Desktopで、Web上のダウンロードボタンを押し、ファイルを保存するフローを作りました。

ファイル保存ダイアログ上の操作には、UIオートメーションを使い、

保存するファイルのフルパスを指定したり、保存ボタンを押したりしています。

Chromeのウィンドウがひとつも無い状態でフローを実行すると、何の問題もなく成功しますが、

先にChromeが動いている状態でフローを実行すると、

ファイル保存ダイアログでファイル名を指定するタイミングで、先に起動していたChromeが前面に表示されてしまい、

PADはファイル保存ダイアログ上のUI要素を見つけられなくなるので、エラーになってしまいます。

エラーは「テキストボックスに書き込めません。(テキストボックスが見つかりません)」です。

フローで作成したChromeインスタンスか、ファイル保存ダイアログを前面に持ってくるなどして、

うまく動作するようにすることはできないでしょうか?

或いは他の解決法があるでしょうか?

6 REPLIES 6
VJR
Super User
Super User

Just before populating the text, Attach to the right Chrome window using any of the options in the "Attach to Chrome tab".

 

VJR_0-1653274477322.png

 

Masanori
Regular Visitor

Thank you very much for your kind instruction.

"Launch new Chrome" action succeeded in a paticular way.

 

Failed flow:

(a Chrome instance running (A))

1. Launch new Chrome instance (B)

2. Click link on web page (download button on B)

3. Launch new Chrome - Attach to running instance B

4. Populate text field in window (B) <- one second after this action begins, chrome window A came to the front.

 

Succeeded flow:

(a Chrome instance running (A))

1. Launch new Chrome instance (B)

2. Click link on web page (download button on B)

3. Launch new Chrome - Attach to running instance A (differ from the failed flow)

4. Launch new Chrome - Attach to running instance B

5. Populate text field in window (B)

 

Titles (URLs) in the Chrome A is varying, so I can't choose the above idea.

And the web page with the download button not always in the Chrome A.

Is there any good solutions?

The "Launch Chrome" has 3 options i. Title, ii. URL and iii Foreground window.

Are you saying it is not possible to attach using any of the 3 options?

 

Also remember, the Title OR the URL, both can also take portion of it

 

VJR_0-1653361956398.png

 

Masanori
Regular Visitor

> Are you saying it is not possible to attach using any of the 3 options?

Yes, I am.

 

> 3. Launch new Chrome - Attach to running instance B

> 4. Populate text field in window (B) <- one second after this action begins, chrome window A came to the front.

When I use option i. Title or ii. URL, while action 3 is running, Chrome B is in the front.

And during action 4, Chrome A comes to the front.

So actoin 4 fails. Error message : Failed to write in textbox (textbox wasn't found

When I use option iii Foreground window, action 3 fails.

Error message : Failed to assume control of Chrome (communication with browser failed. Make sure add-on is installed).

 

> Also remember, the Title OR the URL, both can also take portion of it

Thank you, I'm aware about that.

 

Fro example, Chrome A has following two tabs:

https://a1.com/*

https://a2.com/*  

and Chrome B has one tab:

https://b1.com/* (a web site for download files)

 

Bun on another day, Chrome A might have following tabs:

https://a3.com/*

https://a4.com/*  

 

So I can't use the following idea:

> 3. Launch new Chrome - Attach to running instance A (using option i. Title or ii. URL)

> 4. Launch new Chrome - Attach to running instance B (using option i. Title or ii. URL)

> 5. Populate text field in window (B)

VJR
Super User
Super User

 

VJR_0-1653448072388.png

 

 

You are trying to explain very well using A and B. It is me who is not able to fully understand 🙂

 

In the beginning, can you get the title and url of the browser instance, save it and use it later to attach when required to the right window?

 

Masanori
Regular Visitor

Thank you for your polite explanation.

I was not clear. Chrome A was launched by someone (not PAD) and has been running for weeks.

So I'm not sure how to make some suitable variables for the argument "web browser instance",

I think using "custom selector" of PAD might be a solution.

 

Or, if only I could add a new tab to the Chrome A (also need an argument "web browser instance"),

"populate text field in window" action will work fine.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (2,054)