Testing Framwork Chrome PDF opening option in extensionless mode

3 Answers 27 Views
Chrome
Zsolt
Top achievements
Rank 1
Iron
Zsolt asked on 05 May 2025, 01:36 PM

Dear Telerik Support Team,

 

Several automated tests of ours started to be failing as PDFs are not opening up in Chrome, rather they are tried to be opened externally (screenshot 1). We wanted to check the PDF settings in Chrome, however the settings seemed to be correct. Then we figured out that since we just started to use extensionless mode by adding this line into our code:

Settings mySettings = new Settings();
mySettings.Web.......

mySettings.Web.......

mySettings.Web.UseBrowserExtension = true;

it seems that the Chrome is opened up by you with a different profile. If we are correct, "your" profile is located at this location, right?

C:\Users\Tfs3Tester\AppData\Local\ArtOfTest\TSChromeUserData\Default

Here in Preferences if we are modifying this part ""always_open_pdf_externally":true" to FALSE, then surprisingly its value always set back to TRUE, every time if a test run (with vstest.console.exe) is opening up th eChrome browser.

Also we tried to define the default PDF opening behaviour in the registry, based on this link of yours:

Custom Chrome Profile - Progress Test Studio

No luck, we tried to define a Chrome profile, but we couldn't properly.

 

So my quetion is the following: if a test opens up Chrome with extensionless mode, how can we make sure that PDF's are opening up inside the Chrome browser? How to configure that settings?

 

Best regards,

Zsolt

Stacy
Top achievements
Rank 1
commented on 14 May 2025, 04:17 PM

I am running into this same issue, so frustrating!
Elena
Telerik team
commented on 16 May 2025, 09:10 AM

Hi Stacy, 

Please, check the communication below to find further details on the occurrence.

Thank you for your understanding!

Regards,
Elena

3 Answers, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 06 May 2025, 08:51 AM

Hello Zsolt,

As far as I understand you use the Test Studio Testing Framework to build your tests. Please, note that this is a free product with no active support included, but you still can contact the Test Studio team via our public forum. Therefore your submitted support ticket under your active license was converted to a public forum post which can be accessed with this link

Let's head to the issues you experience. I'll start with several important notes which you seem to have missed. 

  1. Test Studio supports PDF file validation out-of-the-box and it requires certain browser settings because the behavior is predefined - PDF files are always downloaded and then the local file is opened in new tab. 

    Note: In the case when you develop the tests in code, none of these actions happen automatically and you need to handle it accordingly. 

  2. The browsers used from Test Studio requires calibration which is a set of settings applied in the browser so that it behaves as expected from the tool. In the browser mode with extension (which is now deprecated) the calibration was done manually. Thus, it was easily skipped by users and this is how your browser settings related to handling PDF files remained unchanged. 
    The calibration in the browser without extension happens automatically on browser startup and you cannot change the settings.
  3. Custom browser profile and path settings applies only to browser mode with extension. Thus these are also deprecated but obviously we missed to update the documentation accordingly. We'll take care of this as soon as possible. 

With that said I have to say that you need to adjust the tests which interact with PDF files so that these correspond to the workflow which Test Studio can handle. In other words - download the PDF, then open it from the local folder and connect the execution to the new browser tab, then close the new tab and continue with the rest of the scenario. 

I hope that this information is useful for you. Let me know in case you have any additional questions.

Regards,
Elena
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Zsolt
Top achievements
Rank 1
Iron
answered on 06 May 2025, 08:16 PM

Dear Elena,

 

So basically there is no way of changing this setting here in extensionless mode:

We just would like to make sure, that if our code starts a new Chrome browser in extensionless mode, then that PDF setting is set. That would fix our tests.

 

Thank you,

Zsolt

 

Elena
Telerik team
commented on 08 May 2025, 08:12 AM

Hi Zsolt, 

Test Studio uses a specific workflow to validate PDF files as part of a web test. The workflow is as follows:

  1. Download the PDF file locally on the executing machine.
  2. Open the PDF file in new tab in the browser from its local storage directory. 
  3. Connect the execution process to the new tab.
  4. Perform validation as per requirements.
  5. Close the popup and connect the execution process back to the original tab.

To comply with this workflow it is a requirement to set the browser settings to always download PDF files which means you cannot change the setting in the browser used from Test Studio. 

In order to fix the failing tests you need to rework these so that they follow the above workflow.

Regards,
Elena

0
Zsolt
Top achievements
Rank 1
Iron
answered on 15 May 2025, 06:34 AM

Dear Elena,

 

Sorry, but we don't really understand your point. We cannot download the PDF file locally, also we don't want to. We have an information management software that can display document (in any kind of format) WITHIN the browser. So you can browse in categories, and you can open up a document and view a document in the browser itself -> this is what we are testing with automated tests, the automated test is opening up a document in the browser, and checking whether the document is really open. We DO NOT want to download it, our users would like to see it in the browser,  and they can as the set the browser settings to "view PDFs in the browser" in Chrome.

So our software is working for our users, however we cannot test with Telerik Testing Framwork the same behaviour. We would like to test our software, and downloading the PDF locally, and opening it up in a new browser tab is not something our software is doing. 

My question is still the same, how can we change the Chrome browser settings - focusing on PDF display settings - in extensionless mode? We would need to change the PDF display setting to "display in Chrome", and then all of our tests which were working so far with that settings would be working again.

 

Thanks,

Zsolt

Elena
Telerik team
commented on 16 May 2025, 09:10 AM

Hi Zsolt, 

Currently the PDF workflow is designed in the above described way and this is how Test Studio is set to handle this type of files.

I understand that this doesn't suit your needs and therefore I'm submitting a feature request on your behalf. You can find it here on our public feedback portal

In the meantime I also identified a possible workaround. It is applicable only for Edge browser. 

  1. Set the default application to open PDF files to be Edge browser.
    Win Start Menu -> Settings -> Apps -> Defailt Apps.
  2. Execute the tests in their current state in Edge. 

I hope this works for you. 

Regards,
Elena

Tags
Chrome
Asked by
Zsolt
Top achievements
Rank 1
Iron
Answers by
Elena
Telerik team
Zsolt
Top achievements
Rank 1
Iron
Share this question
or