Chamba Absent Member.
Absent Member.
9315 views

Pop-up dialog box warning disables QTP and desktop

Jump to solution
I have a problem where in my application a dialog warning pop-up is displayed (correctly) but the whole desktop including QTP is disabled until 'OK' is pressed. i.e. while this dialog is displayed user is unable to do anyhting or tab between applications. So the QTP step to Click OK cannot execute and the script just stops until the OK is manually clicked.

Can anyone suggest how i can keep QTP active and get it to clear this dialog box?
0 Likes
1 Solution

Accepted Solutions
Cody Marcel Absent Member.
Absent Member.

Re: Pop-up dialog box warning disables QTP and desktop

Jump to solution
Did you get a response back about the modal function call from development? If this is the problem, another tool will not solve it. Let me explain what is happening.

When QTP script runs the line obj().SelectCell, it makes a call to the underlying application object. This means that it releases the context to the application itself. In most cases, the application will do its business and return context back to QTP so it can proceed. With modal = true, the application itself is waiting for input from the user before it returns that context back to QTP. So in a sense, you have a deadlock type of situation because the application is making a blocking (modal) method call. To get around this, development has to change the code to set modal to false.

14 Replies
Rhonda Robinson Absent Member.
Absent Member.

Re: Pop-up dialog box warning disables QTP and desktop

Jump to solution
Personally, I would report this to the developer or vendor of the application. A pop-up in one application should only affect that application and not the entire system.
0 Likes
sridhar.upputur Absent Member.
Absent Member.

Re: Pop-up dialog box warning disables QTP and desktop

Jump to solution
Hi Chamba,

Can you try with silent test runner, i am sure that will solve your situation.

Let me know if you need any more information.

Thanks,
Sridhar
0 Likes
Absent Member.. Erodabasi Ataca Absent Member..
Absent Member..

Re: Pop-up dialog box warning disables QTP and desktop

Jump to solution
Hi Chamba,
try to modify the last step before this message appears. Use wshshell fore example.
The problem is not that QTP cannot click on OK. The problem ist that QTP has not finished the last step.
QTP is waiting for a response from your Testapplication in order to go on with the next step.
Is your testapplication a Webapplication or Java-Application??

Regards
A.E.
0 Likes
Krishna Kolacha Absent Member.
Absent Member.

Re: Pop-up dialog box warning disables QTP and desktop

Jump to solution
Looks like the developers implemented a "System Modal" dialog instead of an "Application Modal" dialog in their code. They need to fix it.
0 Likes
Cody Marcel Absent Member.
Absent Member.

Re: Pop-up dialog box warning disables QTP and desktop

Jump to solution
Krishna is correct, but it was probably done on purpose by the developers. I hit this problem once and we had to have a test version of the application to be compatible with automation. The test version turned the modal flag to on and off.
0 Likes
Chamba Absent Member.
Absent Member.

Re: Pop-up dialog box warning disables QTP and desktop

Jump to solution
Thanks for your replies. I have fired the query about System Modal v Appliaction Modal to the Dev team.

In the meantime, A.E: it's a PowerBuilder application. The previous step is to tab out of the cell that it has set - which triggers the pop-up dialog. Can you tell more what you mean by 'try using wshshell?'
0 Likes
Absent Member.. Erodabasi Ataca Absent Member..
Absent Member..

Re: Pop-up dialog box warning disables QTP and desktop

Jump to solution
Can you please write the line where the problem occurs and the line before too.

Here is an example for wshshell:

Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "{ENTER}"
Set WshShell = Nothing
(You can replace ENTER with F1, F2, SHIFT ...)
0 Likes
Maheshwar_1 Absent Member.
Absent Member.

Re: Pop-up dialog box warning disables QTP and desktop

Jump to solution
Why dont you go for Recovery scenario for clicking the "Ok" button when ever it is displayed.

Regards
Maheshwar
0 Likes
Chamba Absent Member.
Absent Member.

Re: Pop-up dialog box warning disables QTP and desktop

Jump to solution
Recovery scenarios do not work. Nothing QTP related works because it is not responding.

AE, please find the previous couple of lines and the code i'd like to execute on the pop-up. Any thoughts gratefully received. I am still getting this problem and it is now a showstopper. We will be looking for another test tool if this is not solved. HP have not replied to a ticket i raised.

PbWindow("w_mdi").PbWindow("w_allocation").PbDataWindow("dw_shipment").SelectCell "#1","c_enddate"
PbWindow("w_mdi").PbWindow("w_allocation").PbDataWindow("dw_shipment").SetCellData "#1", "c_enddate", DataTable("p_Arrival", dtLocalSheet)
PbWindow("w_mdi").PbWindow("w_allocation").PbDataWindow("dw_shipment").SelectCell "#1","c_platform_abbreviation" ' this step tabs out of the PB cell and generates the pop-up dialog box

Then i would like to perform the following simple conditional - but cannot due to QTP freeze...

wait 0, 500
If PbWindow("w_mdi").Dialog("Warning").Exist(1) Then
PbWindow("w_mdi").Dialog("Warning").WinButton("Yes").Click
End If
0 Likes
Cody Marcel Absent Member.
Absent Member.

Re: Pop-up dialog box warning disables QTP and desktop

Jump to solution
Did you get a response back about the modal function call from development? If this is the problem, another tool will not solve it. Let me explain what is happening.

When QTP script runs the line obj().SelectCell, it makes a call to the underlying application object. This means that it releases the context to the application itself. In most cases, the application will do its business and return context back to QTP so it can proceed. With modal = true, the application itself is waiting for input from the user before it returns that context back to QTP. So in a sense, you have a deadlock type of situation because the application is making a blocking (modal) method call. To get around this, development has to change the code to set modal to false.

Krishna Kolacha Absent Member.
Absent Member.

Re: Pop-up dialog box warning disables QTP and desktop

Jump to solution
Assuming any application other than QTP can still work when the popup is displayed, you can try coding (very little infact) in autoIT (available for free on the web) to look for that dialog and acknowledge it.

Basically the exe (its scripts can be compiled as standalone EXEs) of autoIT script should keep looping looking for that dialog and click on OK or whetever button it is when it is found. Note that this is just a workaround. The coding required in autoIT for this is very minimal and (incase you are not familiar with it), the learning curve for just the above task is very minimal.
Chamba Absent Member.
Absent Member.

Re: Pop-up dialog box warning disables QTP and desktop

Jump to solution
Thanks for your replies Cody and Krishna,

Dev team insist that all dialogs are the same and when i ask about modal = true and modal = false they say there is no such setting. I don't have access to the code so cannot confirm this.

I like the sound of the autoIT app. It sounds similar to a workaround used for a very similar problem with an Outlook pop-up. I will check this out as a potential temp workaround...

thanks
0 Likes
Chaim Rutenberg Absent Member.
Absent Member.

Re: Pop-up dialog box warning disables QTP and desktop

Jump to solution
I am having the same issue with a Modal window. I actually have a sub function, from a function library, that opens the menu item of the window. The function opens the window (as it does any other menu item). However QTP waits until I manually close the application. The issue I am having is that I need to run tests on the open window.
0 Likes
Absent Member.. balu_2903 Absent Member..
Absent Member..

Re: Pop-up dialog box warning disables QTP and desktop

Jump to solution
Hi, I have a popup window appearing as below. the class of popup is "window", parent is "Browser" Browser("x").Window("x").webbutton("ok").click The above statement not working during runtime and QTP gets hanged i.e until some action is performed on the popup window the control is not returned to QTP, but the popup window and objects are recognized properly for test objects repository. Please do the needfull.
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.