Quantcast
Channel: Micro Focus QTP (UFT) Forums - All Forums
Viewing all articles
Browse latest Browse all 1653

QTP not clicking on the flex button

$
0
0
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.

Viewing all articles
Browse latest Browse all 1653

Trending Articles