Switching to Chrome Save As Window to Keystroke Filename

Hello -

I’ve encountered an issue where I am in Chrome, I click on a pdf document, when the pdf document opens in a different tab I right-click on it to select “Save As”, but then I cannot perform any action in the “Save As” window that opens. The need is for me to be able to switch over to the “Save As” Chrome window and use variables to keystroke the filename, but I keep getting an error. Any ideas how I may be able to achieve this?

Thanks in advance for any assistance!

Hi @jdillon_lpnt what error do you get?
Do you switch to this window using Window action?

The error that I get is “Error executing SwitchToBrowserAction” on step 100 of the attached code.Workfusion Code.txt (32.3 KB)

Can you zip and share the folder with the .rpae file to have a look at it?

Yes, it is attached to this post. Let me know if I can provide anything else to help you understand what it is I am trying to achieve. Thanks for your help!

~Assessment Report for PDF Extract.zip (1.1 MB)

So the script doesn’t fail when you try to switch to the Save As window.
It fails when switching back to the browser window.

Can you share the full text of the error?

Yes, it is attached. The odd thing, that I can’t figure out, is that if I create 2 separate rpae files and split up the tasks, it will allow me to click within the Save As dialogue box and use Keystrokes. I’ve attached another zip file containing the 2 rpae files that support this. I first run HealthStream - Pulling Report for Assessments.rpae and then follow it with running HealthStream - Checking if file already exists.rpae and the second rpae file runs as expected. When I combine them, it fails.

SwitchToBrowser Error.txt (13.2 KB)

~HealthStream - Pulling Report for Assessments.zip (1.2 MB)

Thank you @jdillon_lpnt

It looks like in the action 94 you close the window or tab in the browser, so the bot cannot switch back to it using Switch to Browser.

Try removing the action that closes the window and using Open website instead of Switch to browser, like in your second script.

Let me know if it helps)

@ashapkina - Thank you for your quick response. The close action in 94 is manually going into Excel to close Excel. Since I am not running the Excel actions through the Open Spreadsheet action, I thought that I would need to close Excel through actions in the Actions Flow.

Sorry, I wrote the wrong step. Do you close a tab in the browser in step 46?


You are right about Excel, you need to close it before using Excel actions.

@ashapkina - Yes, I close that tab, but there is another that remains open.

But as I understand, the focus of the driver was on the tab that was closed, and it cannot switch to it.

Alternatively, try to switch to the previous tab using a custom action, and then close the current tab.
In this case, the bot should be able to switch to the browser.

@ashapkina - Thank you! That worked to get back into the browser, but then it errs whenever it gets to the Keystroke action on step 172. Attached is the error code. This is the trouble I had originally, and I tried to prevent it by writing the Switch to Browser action.

KeyboardAction Error.txt (8.4 KB)

Does that action type into the pop up window?

This issue can happen in RPA Express 2.2.

You might need to switch to it using Window action.
However, as it is inside the Open website action, you might not be able to do it.

This issue has been fixed in version 2.3 - you can type in windows without switching to them

@ashapkina - I’ve downloaded and installed the updated version, and I’m still getting keystroke errors when trying to type in the Save As dialogue screen. Any thoughts?

Have you enabled the option “Enable typing in any window without explicit switching” in the Preferences?

Hi @jdillon_lpnt did enabling this option help you?

@ashapkina - Yes, that was what was preventing the typing. I adjusted that setting, and everything worked as expected. Thank you for your help!

1 Like

@jdillon_lpnt happy I could help :slightly_smiling_face: