Highlighted
Contributor.
Contributor.
1883 views

Web Truclient PDF download windiws dialouge not recorded - IE11

Hi,

My AUT doesn't support firefox, chrome browser and only work with IE.

Problem:

When recording business process and clicking to a button (i.e., GENERATE) the application generate a pdf document and a windows dialouge popup to save the document locally.

Recording is fine upto the clicking on GENERATE button but web trueclient doesn't record anything relate to window dialouge related action?

Please can some one please suggest  me what's wrong here ?

0 Likes
14 Replies
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: Web Truclient PDF download windiws dialouge not recorded - IE11

It is because Save the PDF is the windows native object. You need to write JavaScript code to save the PDF. 


Thank you,
NaveenKumar Namachivayam | www.QAInsights.com
Learn TruWeb - my Udemy Course "Performance Testing using TruWeb" | https://www.udemy.com/performance-testing-using-truweb/?couponCode=YOUTUBE
0 Likes
Highlighted
Contributor.
Contributor.

Re: Web Truclient PDF download windiws dialouge not recorded - IE11

Sorry but can you share the java script code if you have already ?

0 Likes
Highlighted
Contributor.
Contributor.

Re: Web Truclient PDF download windiws dialouge not recorded - IE11

Hi Shlomi

Can you please suggest me some thing on this please?

 

Regards

KAPIL

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Web Truclient PDF download windiws dialouge not recorded - IE11

Hi Kapil,

Please open a support call to get help for suppressing the dialog. It might be possible to download the file automatically to a specific folder or alternatively it should be possible to suppress it using C function.

Please see below an example for such C-frunction. You need to call this function from TruClient script right after the button click that triggers the PDF download

void pressCancelOnDownloadDialog() 
{
    int nDownloadWindow;
		
    lr_load_dll("Kernel32.dll");
    lr_load_dll("User32.dll");
   
    nDownloadWindow = FindWindowA(0, "File Download - Security Warning");
    if (nDownloadWindow != 0) 
	{
    	        lr_output_message("found download window %u", nDownloadWindow);
		PostMessageA(nDownloadWindow, 256, 27, 0);
		PostMessageA(nDownloadWindow, 257, 27, 0);
	}
    else 
    {
	    nDownloadWindow = FindWindowA(0, "File Download");
	    if (nDownloadWindow != 0) 
		{
	    	        lr_output_message("found download window %u", nDownloadWindow);
			PostMessageA(nDownloadWindow, 256, 27, 0);
			PostMessageA(nDownloadWindow, 257, 27, 0);
		}
    }
}

 

BTW: the goal is not to suppress this dialog during record but during replay. TruClient does not record Operating System native dialogs and it is not going to change anytime soon.

 

Regards,

Shlomi

0 Likes
Highlighted
Contributor.
Contributor.

Re: Web Truclient PDF download windiws dialouge not recorded - IE11

Hi Shlomi,

Thanks for the reply.

 

I dont have SAID right now as I am implimenting POC to proov that Loadrunner web trueclient and other protocol combination is fit for our load testing purpose so I am unable to raise this  support call. 

Can you help me how I can raise it or if some one can raise it on behalf to assist me on this issue ?

Thanks in advance

Regards

KAPIL

0 Likes
Highlighted
Contributor.
Contributor.

Re: Web Truclient PDF download windiws dialouge not recorded - IE11

Hi Shlomi,

Support call request 5318753149 raised .

 

Regards

Kapil

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Web Truclient PDF download windiws dialouge not recorded - IE11

Good. I am sure HPE support can assist with it.

In any case please try the workaround I have given above

Regards,

Shlomi

0 Likes
Highlighted
Contributor.
Contributor.

Re: Web Truclient PDF download windiws dialouge not recorded - IE11

Hi Shlomi,

I have tried your work around and it's suppressing the dialog but not downloading pdf file locally ?

My goal ii to save the generated pdf file in each iteration.

Regards

KAPIL

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Web Truclient PDF download windiws dialouge not recorded - IE11

Hi Kapil,

Please check TruClient Advanced Scripting Techniques webinar around the 65th minute.

Regards,

Shlomi

0 Likes
Highlighted
Contributor.
Contributor.

Re: Web Truclient PDF download windiws dialouge not recorded - IE11

Thanks Shlomi, I am watching this from last 1 week but i  think either I am not able to capture some thing correct or some thing  is wrong in my understanding.

So in my scenario when I click the "Generate" button then it launch a windows popup, asking user to save the pdf locally in  the disk

So as per your suggest I have applied your first work around (pressCancelOnDownloadDialog) immidialy after click Generate button action so it is surpreesing windows dialog box correctly and after this i have added another evalute C funtion for "MeasureFileDownloadTime" but I think I am not capturing correct URL so getting following message in log file

open = InternetOpenA("DownloadURL",0,0,0,0);

 if(open)
  {
  lr_output_message("%s", "Opening URL: XXXXX");
   url = InternetOpenUrlA(open, "XXXXXX",0,0,0,0);
   lr_output_message("url: %s", url);

 

Log file Extract

t=00216992ms: ** 20: Evaluate C function pressCancelOnDownloadDialog ** successfully completed with end event 'Step synchronous network completed'    [MsgId: MMSG-205180]
t=00217018ms: ** 21: Evaluate C function MeasureFileDownloadTime ** started    [MsgId: MMSG-205180]
Opening URL: XXXXXX
url: (null)
Notify: Transaction "TRX_01_Downloadfile" started.
Reading URL: XXXXXXX
Not Downloading
t=00217038ms: The "MeasureFileDownloadTime" C function returned 0    [MsgId: MMSG-205200]
t=00217433ms: ** 21: Evaluate C function MeasureFileDownloadTime ** successfully completed with end event 'Step synchronous network completed'    [MsgId: MMSG-205180]
t=00217448ms: ** 23: Wait 10 seconds ** started    [MsgId: MMSG-205180]

Any suggestion ?

 

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Web Truclient PDF download windiws dialouge not recorded - IE11

Hi Kapil,

I guess you do not know the URL of the PDF file in advance, right?

Did you try capturing it somehow? For example: after clicking on the "Generate" button check the DOM for an element that contains the URL and feed the C function with it. 

Another option is instead of clicking Cancel in the File Download dialog, click Save. Then another dialog will popup. Use the same function that clicks Save on the File Dialog, only this time look for a different title and Click OK to save the file.

Regards,

Shlomi

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.