Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Highlighted
JM9 Contributor.
Contributor.
803 views

Pop up blocks to replay the Truclient Scripts

Hi

When i am replaying the Truclient scripts,we are getting Pop Up message "Do you want to leave this Site? with options Leave or Stay"(PFA Snap shot for reference).

It is stopping the functional flow when i am replay the script.

Could you please let me know the suitable solution to overcome this issue.

Vugen Version- 12.55

Browser:Chromium

 

 

0 Likes
7 Replies
Edo Nir Outstanding Contributor.
Outstanding Contributor.

Re: Pop up blocks to replay the Truclient Scripts

Hi JM9,
You can try using the "Dialog - Confirm" step to dismiss the dialog.
To add this step, drag a Generic Browser Action step from the Toolbox into the relevant part of your script, then in the Step section's Action field, select Dialog Confirm action. In the Arguments section, input the text of the button you'd like to click.

Edo
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Pop up blocks to replay the Truclient Scripts

Hi,

This dialog is popup because in the page, some event handler(s) is assigned to window.onbeforeunload event. Actually TruClient Chromium handles this case, by eliminating window.onbeforeunload event handler(s) assigned by the page. But, there is one case TruClient can't hanldle. The case is, the page assigns window.onbeforeunload event handler(s) using below code after "load" event of the page happens.

window.onbeforeunload = function() { /* some code */ };

Using below code won't cause this problem.

window.addEventListener("beforeunload", function() { /* some code */ });

Please check with page code, if the former code exists and it's executed after "load" event of the page. If so, TruClient Chromium doesn't support it.

 

0 Likes
JM9 Contributor.
Contributor.

Re: Pop up blocks to replay the Truclient Scripts

Thanks Edo, 

Followed the approach you suggested but observe issues in providing the text of the button in arguments section.Please find the attched screen print for your reference

 

0 Likes
Edo Nir Outstanding Contributor.
Outstanding Contributor.

Re: Pop up blocks to replay the Truclient Scripts

Hi JM9,

My previous response was incorrect.

First, the "Dialog - Confirm" may not be able to handle leave-confirmation dialog, as this is a different kind of dialog.

The response from @Alex Zhou is the correct one. 

 

Also, the "Dialog - Confirm" step only allows selecting button names from the provided drop-down list.

If you hover your mouse over the error exclamation mark, this will be indicated in a tooltip.

 

Edo

0 Likes
JM9 Contributor.
Contributor.

Re: Pop up blocks to replay the Truclient Scripts

Thanks Alex,

We are in progress of implementing the solution you proposed. Once window.onbeforeunload event handler(s) assigned by the page is eliminated what will be the expected output weather we get the pop up or pop up will not appear ()?

If we get the pop up even though window.onbeforeunload event handler(s) assigned by the page is eliminated , can you please suggest me how to handle it in Truclient.

If the pop up did not appear can I conclude the issue is resolved?

 

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Pop up blocks to replay the Truclient Scripts

Hi,

Once window.onbeforeunload event handler(s) assigned by the page is eliminated, the pop up will no longer appear. Therefor, this issue should be solved.

BTW, I noticed you tried to eliminate window.onbeforeunload event handler(s) by executing an "Evaluate JavaScript" step with below code.

window.onbeforeunload = null;

This won't work. It's too technical to explain why. But unfortunately, I have to say, it won't work.

 

0 Likes
CharlieQA7
New Member.

Re: Pop up blocks to replay the Truclient Scripts

Hey what was the fix for this pop-up? I get do you want to leave this site, Leave or Stay. Any ideas how to make Truclient to click on Leave?

 

Thank you,

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.