Can not switch from desktop application to pdf opened in the browser

Hello, everyone,
I have a trouble finding a solution how to switch from desktop application to PDF which is opened in browser.

Here are the actions that are happening:

I am writing automation for testing Desktop application. At the end of the flow that I am testing, PDF file is generated but is directly opened in browser tab. I am trying the RPA.PDF library but it is giving me error that no PDF file is opened. Did someone got the same issue as me and what is the solution for it?

Thank you in advance,

Lora Lambreva

Mhm, is the file saved to temporary location before opening in browser? RPA.PDF expects file, not browser. If temp location is not available there would also be an option to set up solution > How to use an already running (Chrome) browser for your web automation robots

1 Like

I tried with this example but I and getting error RPA.core.webdriver has no attribute ‘cache’ so again something is not working as expected. Any ideas?

Thank you,
Lora

1 Like

Hi @lambreva.lora , that cache error is coming as a leftover from the major upgrade we had to Selenium 4. Using the latest rpaframework==16.3.0 in your conda.yaml will have that fixed, so please upgrade first!

Here’s the robot example I tested with and it looks like the keyword is working as expected. (video demo)

Make sure you:

  1. On a Mac for example open Chrome like so: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
    a. Ensure you had no Chrome open previously by quitting the app first.
    b. Check with ps aux | grep -i "9222" to see if now the newly opened browser is really on that port.
  2. In VSCode with Robocorp extension installed, run Cmd/Ctrl+Shift+PClear Robocorp and press Enter so you clean your env first.
  3. Same action, but this time select Run Robot and pick the task you’d like.

Similarly, you can do the same with rcc:

  1. rcc config cleanup --all
  2. rcc run -t <task>

Let us know if you still have problems and good luck with the robot development!