Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP not clicking on the flex button
#1
Not Solved
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.
Reply
#2
Not Solved
Try this,

Code:
Settings.Webpackage("ReplayType") = 2
FlexObject.Click
Settings.Webpackage("ReplayType") = 1
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#3
Not Solved
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question [HELP]Button no longer works in the transaction ME21N(SAP/QTP) rafaponzio 11 9,554 12-21-2022, 06:08 PM
Last Post: Carlos Veras
  Clicking command button in accesss form mark_cielos24@yahoo.com 1 3,169 05-07-2013, 10:52 PM
Last Post: agarwl.anurag
  Problem with QTP recognition of Flex objects in web-based GUI using Firefox & Chrome nancyanne18 0 2,412 10-25-2012, 08:11 PM
Last Post: nancyanne18
  How to Download a Excel File, while click on Button in qtp 10.0 branjitk 4 4,591 06-06-2012, 06:01 PM
Last Post: branjitk
  Dot Net Factory Button click to run action in QTP nutsndips 1 4,229 06-21-2011, 08:37 PM
Last Post: nutsndips

Forum Jump:


Users browsing this thread: 1 Guest(s)