Pulling down PDF documents

I am a complete newb with automation testing, so please be kind.

I am on a automation team that is currently trying to pull documents from websites, in particular PDF files.
I am currently trying to fill a gap that we have, and trying to use Katalon.
I had a minor issue with password, and resolved it.
Now I am on the website, put in a reference number, click on Submit.
A new window opens up with the actual PDF document to view.
From what I can tell, Katalon looses the focus, thus can not record the event after the Submit button is pushed.

I am using Katalon 7, on Windows 10.

I did some searches, and found some threads, but those were on older versions of Katalon and early last year.

Any help would be greatly appreciated.

Thank you

Randy, read this and share whatever you think might be relevant:

Russ_Thomas, I would provide code/logs, if they were available.
When I use the record option, I observer what is actually posted on the screen.
When I get to the point of clicking on the Submit buttion, a new window or tab opens(dependant on which browser I am using), and Katalon looses focus, the recording stops and the log file stops.
There are more steps after step 8, but because Katalon looses focus of the new tab/window, it does not capture what is going on.
Now if I close the new tab/window, return to the original browser window, Katalon continues to record what I do.
I have tried all the browsers available to Katalon, each with the same issue.
I upgraded to version 7, because I had the same problem with version 6.3.3.

Sorry, Randy, I don’t use the recorder so I can’t help. I’ll move this to the Web Testing category. Maybe some else will chime in.

If you’re game, in Script view, you need to use WebUI.switchToWindowIndex()


Hi @Randy_Feezor

That sounds weird. Can you capture a video (or a gif) for us to see if anything is going on ? A simple tab/window opening should not strip the Web Recorder of its recording ability.

Also, when you reproduce this issue, look under Help > Error Log and upload the file here.

1 Like


Here is what you requested.
I appreciate your help.

Thank you

2019-09-25_10h16_13.zip (3.1 MB)
Katalon.log (46.6 KB)

Ah @Randy_Feezor

I finally understand the problem. Chrome renders pdf under what is called a shadow-root

In fact if you inspect the tab containing the pdf you will see something like #shadow-root(open). It’s sorta like iframe in the sense the HTML inside it is encapsulated. Katalon Studio currently doesn’t support recording this yet ( I don’t know any tool that does though ).

What you can do though is to use keyword SendKey to simulate Ctrl + S, as proposed in this post:

Then use Robot framework to click the button. It may take some work, but it can be done.

1 Like

I saw that in some of the posts that I read. But, when I attempted with other browsers, I had the same results.
That is when I turned to the community to ask about it.
I will check this out.

Thank you