Wrong PDF download only with UI-Path

Hello everyone,

I have a very specific problem with one of my web automations. I’ve never had a similar problem before. I hope someone can help me.

It’s a simple automation. I log in, open an ID, and click “Download PDF.” The PDF is a generative PDF that is populated with the current page content using a Java script.

When the download is done via the robot, I get an “old” PDF that was already downloaded in a previous session.

The funny thing is, if I make the exact same clicks as a human, on the same machine, with the same settings, I get the correct PDF that matches the page content.

I’ve been trying to solve this problem for weeks, but nothing has worked. I suspected that UI-Path wasn’t triggering the corresponding event listeners, but I’ve already ruled that out. I’ve tried all click variations.

Unfortunately, it’s a company website, which I can’t share here.
I can say, however, that it was built with Vaalin.

The problem occurs in both Edge and Chrome.

Has anyone had a similar issue?

It looks like UI-Path is caching something.

Thanks

Can you try to do it in Incognito mode or private session, so there wont be any old cache or session storage.

Hello @pxx789

As @adi.mehare suggested you could try to open the browser in incognito-mode.
You would do this by setting the property Incognito/private window to True on your Use Application/Browser container.

As an alternative you could also try to use a Keyboard Shortcuts activity to send Shift+F5 to force a refreshed page before download.

Regards
Soren

1 Like

Thanks for your help.
Unfortunately, I’ve already tried both. Without success.
It doesn’t seem to be the browser caching anything.

I’m particularly surprised that this only happens through automation, not through manual input. It seems as if UI-Path is processing the website differently internally and might be caching something itself.

Thanks anyway!

A job can’t cache a downloaded file. Are you making sure to delete existing files before downloading the new one?

@pxx789

welcome to the community

try open ID also with hardware events click and also download pdf with hardware events click

One thing you can check is while running manual and with bot if there is any difference that you see in network tab

cheers

I’ve also tried hardware clicks.
Unfortunately, that didn’t work either.

Of course, no PDF is cached. But as is often the case with generative PDFs, a GET request is sent with the current frame content, followed by a POST response containing the PDF. Both GET and POST contain the “no-caching” header.

So my theory is that UI-Path isn’t updating the current frame correctly, even though the correct frame is actually displayed on the monitor. Perhaps the website has bot protection and isn’t responding to automated input.

@pxx789

if website is trying for bot protection then hardware events cannot be caught…unless you do some other input method to nab=vigate to page so when you do such clicks try to do it for all events instead of doing it only for the final click

also did you check the network tab that is where you can find what is being passed to know if you theory is correct

cheers