Our vBulletin migration is complete.
Welcome vBulletin users! All content and user information from the Micro Focus Forums (vBulletin) site has been migrated to this site. READ MORE.
Honored Contributor.. Molina4321 Honored Contributor..
Honored Contributor..
313 views

Click on WinButton sometimes works sometimes it doesn't

In the File Download window dialog that pops up and prompts you with "Do you want to open or save this file?", clicking on the Save button sometimes works and sometimes it doesn't.  Why?

 

Browser("B").Dialog("File Download").WinButton("Save").Click

 

There are 3 WinButtons:  Open, Save, and Cancel.  The focus in on the Cancel button and I don't think it is necessary to set focus on the Save button before clicking it.

 

Running on IE8 and UFT 12.00.

Add-ins: 

.NET

ActiveX

Web

  ASPAjax

 

 

Thanks.

Gilbert

 

 

0 Likes
4 Replies
Highlighted
Absent Member.. vzamoraz Absent Member..
Absent Member..

Re: Click on WinButton sometimes works sometimes it doesn't

Hello Gilbert,

 

     I recommend you to set the focuse on the Dialog using:

     Browser("B").Dialog("File Download").Activate  

 

     Before click on the save button set a wait 1 to ensure that the issue is not syncronization.

     So you should see something like this:

      Browser("B").Dialog("File Download").Activate

   wait 1

   Browser("B").Dialog("File Download").WinButton("Save").Click

 

Regards.

HP support

If you find that this or any post resolves your issue, mark it as an accepted solution.

 

Note: The Opinions expressed in my post are mine alone, and do not reflect the opinions of my employer. No warranties express or implied for any answered posted.

0 Likes
Honored Contributor.. Molina4321 Honored Contributor..
Honored Contributor..

Re: Click on WinButton sometimes works sometimes it doesn't

Hi Victor,

I have the Wait statement before so I added the .Activate this time and it still didn't work.
I issued the .Click on the button a second time and this one works all the time. I just didn't want to check for the "Save As" dialog if it exists or not to do this .Click again.

This is really weird. I have not seen this behavior before in QTP/UFT. I've seen it in SilkTest on one or two AUTs where I had to repeat the action/method .Click as a work-around.
It's like the first .Click on the "Save" button just makes a "blink" or "refresh" on the File Download dialog on the first .Click.

Maybe some other settings (browser or system) that is causing this behavior?

 

I just did experiment on the other buttons "Open" and "Cancel".

"Cancel" button works at all times when clicked once.

"Open" button behaves like the "Save" button where you have to do .Click a second time to make it work at all times.

 

All 3 buttons do "Highlight on Application" without any problem.

Here is the big difference in the Object Repository Description properties settings:

"Cancel" button  -  the "text" property has the value "Cancel"

"Save" button - the "text" property has the value "&Save"

"Open" button - the "text" property has the value "&Open"

 

Notes: 

I did not put the "&" character.  It was there by default when a added the object to the OR.

There is also this property "regexwndtitle" whose value is the same as the value in the "text" property.

Any change to the value such as using regex "*ave" or "*pen" does not work also.

Then I thought of trying this in FireFox but, the File Download is so different.  The only buttons are OK and Cancel.

Open and Save are RadioButtons instead.

Thanks.
Gilbert

0 Likes
Absent Member.. vzamoraz Absent Member..
Absent Member..

Re: Click on WinButton sometimes works sometimes it doesn't

Intresting Gilbert,

 

    If a setting was causing it that would affect all the winbuttons.

    What is the result if you chnage the replay type to mouse?

    Example:

    current_type = Setting.WebPackage("ReplayType") 'save the actual replay type
    Setting.WebPackage("ReplayType") = 2 ' Change replay type to mouse.
    Browser("B").Dialog("File Download").Activate
    wait 1
    Browser("B").Dialog("File Download").WinButton("Save").Click
    Setting.WebPackage("ReplayType") = current_type 'set the original replay type

   

Regards.

0 Likes
Honored Contributor.. Molina4321 Honored Contributor..
Honored Contributor..

Re: Click on WinButton sometimes works sometimes it doesn't

Ok. Let me try your suggestion.

In the meantime, I tried to remove the "&" character from the "Open" and "Save" buttons text property and even the Highlight in Application would fail.

Why is the "&" character included in the "text" property, in the first place? What does it mean?

If intentional designed that way, why is there no "&" character in the "text" property of the "Cancel" button?

This "File Download" dialog seems to be one of those generic pop-up dialogs from the Windows OS.

Thanks.
Gilbert

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.