Micro Focus QTP (UFT) Forums
QTP not clicking on the flex button - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: QTP not clicking on the flex button (/Thread-QTP-not-clicking-on-the-flex-button)



QTP not clicking on the flex button - sudheerch - 12-02-2013

Hi All,

I'm automating a flex application. In my application, I've a browser button which is identifying as flexButton. I need to click on that browser button and then browse a file.

I've written the following code:

Code:
Browser("browser").page("page").FlexApplication("app").FlexTitleWindow("titlewindow").FlexForm("form").FlexButton("Select files to add::Browse...").Click

The click method is not working here. When I user the click method, logically QTP is clicking on the button but the event is not fired. The alternative that I've is to click on mouse co-ordinates. Currently we're using that for the time being.

This issue is specific to this button. All other flexButtons are working fine.

Can anyone suggest me is there any way that I can click on this flexbutton instead of using the co-ordinates which will fail.

as a workaround, I'm using the below function:

Code:
Function fnClickBrowseButton(ObjectHier, XCoOrd, YCoOrd)
    fnClickBrowseButton=False
    set wshObj = createobject("WScript.Shell")
    Set device = createobject("Mercury.DeviceReplay")
    On error resume next
    ObjectHier.SetFocus
    ObjectHier.Click
    wshObj.AppActivate "Dashboard"
    device.MouseClick XCoOrd,YCoOrd, LEFT_MOUSE_BUTTON
    wshObj.SendKeys "{SPACEBAR}"
    set wshObj = nothing
    Set device = nothing
    err.clear
    on error goto 0
    fnClickBrowseButton=True
End Function

Many thanks in advance.


RE: QTP not clicking on the flex button - basanth27 - 12-03-2013

Try this,

Code:
Settings.Webpackage("ReplayType") = 2
FlexObject.Click
Settings.Webpackage("ReplayType") = 1



RE: QTP not clicking on the flex button - sudheerch - 12-03-2013

Hi Basanth,

Thanks for the reply. I thinks it is Setting object but not Settings. I tried the below code but there is no luck. Still the event is not getting fired.

But the click operation is happening for sure. When I click on that button manually, a status message saying "opening xyz window..." will come on the page and the browse window will open.

When I'm clicking through code also, I'm getting that message "opening xyz window..." but the browse window is not opening.