I've recorded a toolbar button click
SwfWindow("CIA System (powered by").SwfWindow("Hedge Fund").SwfToolbar("_Form1_Toolbars_Dock_Area_Bott").PerformToolAction tbmgrToolbar, tbmgrClick, "tlbFund", "Refresh"
When I tried to playback this recorded QTP script, it's not able to identify the toolbar button.
I want to simulate this action
by identifying toolbar button and click event (using Descriptive Programming).
Pl let me know how can it has been done?
ote: Using QTP 10.0 and TestAdvantage_WinForms_HP_20103
Thanks for your support.
Toolbar button click is working properly.
Laxmika,
Thank you for your comments. I will close the case.
Michael S.
So, are you all set now. Do you still require assistance with this case?
Thanks for your immediate response.
Record-n-Playback: It was taking too long time to playback the recorded script - Toolbar button click.
SwfWindow("wndname").SwfWindow("wndname").SwfToolbar("_Form1_Toolbars_Dock_Area_Bott").PerformToolAction tbmgrToolbar, tbmgrClick, "tlbname", "Refresh"
Using Descriptive Programming:
I'm using following approach to click on SAVE button
l = -1, t = -1, r = -1, b = -1btnSavePresent = wndname.SwfToolbar("swfname:=.*Bottom.*").GetTextLocation("Save",l ,t,r,b) 'Find the location of SAVE button on the screen
If btnSavePresent Then wndname.SwfToolbar("swfname:=.*Bottom.*").Click l,t,0 'Click on SAVE Button 'MsgBox "Text found. Coordinates:" & l & "," & t & "," & r & "," & bEnd If
Finding the Button coordinates and clicking by button position.
However, this is not correct approach.
Edited the recorded script by giving the swfname property, now this works fine
SwfWindow("swfname:=wndname").SwfWindow("swfname:=wndname").SwfToolbar("swfname:=toolbarname").PerformToolAction tbmgrToolbar, tbmgrClick, "tlbname", "Refresh"
Laxmikant,
Could you verify that TestAdvantage is configured correctly? Could you look at the SwfConfig.xml file which is located in the "dat" subdirectory where QTP is installed? If you are unsure about it, could you attach a copy of it to this forum post so that I could look at it?
Have you confirmed that the version and build of NetAdvantage under which your application is running is the same as the version and build of TestAdvantage?
Are you able to playback the recorded scripts unsing the sample applications that come with TestAdvantage?