| || |
.Click has to be done 2 times for "Save" and "Open" buttons to work in File Download
In File Download dialog, there are 3 WinButtons (Open, Save, and Cancel).
Highlight in Application always work for all 3 buttons.
When I issue "Browser("B").Page("P).WinButton ("Cancel").Click", it works all the time.
When I do the same for the "Save" and "Open" buttons, it does not work. I have to do the .Click a second time to make it work.
Has anyone seen this behavior in the "File Download" dialog?
Using Windows 7 Ultimate and UFT 12.00.
In the Object Repository, I noticed that when the 3 WinButtons were added, their "text" Description properties are kind of different. The Cancel button has the "text" value of "Cancel", the Open button has the "text" value of "&Save", and the Open button has the "text" value of "&Open".
What is the "&" character or symbol for and why is it not included for the Cancel button?
I think you probably found the cause for the Open & save button not getting clicked. Can you try updating the text value in the OR for Open & Save buttons with regex - "*pen" and "*ave". Let me know if it works
Originally Posted by bhavinvt
Any change you do on this text value such as your suggestion of using regex causes the object to be unrecognized. Even the Highlight in Application will give you an error already.
There is another property called regexwndtitle which is also set to &Save and &Open.
There's something different (weird) with the way these buttons are implemented as compared to the "Cancel" button. I tried using just the nativeclass and window id and Highlight in Application is just fine with them. But issuing the .Click only makes it kind of "blink" then a second .Click with actually bring up the Save As dialog.
I thought I can see if this is repeatable in FireFox but, the File Download is quite different. The Open and Save are RadioButtons and the only buttons to deal with are the OK and Cancel buttons.
Last edited by Gilbert; 04-16-2014 at 08:48 AM.
Reason: added more info
Hello Gilbert, I had same issue while working on popup dialog. Same script will work for the second time click.
In my case, its purely a sync issue. QTP will try to click on the win buttons as soon as the dialog is displayed.
I added a wait of 2 seconds after the dialog is displayed and it is working fine every time.