Hi all,
In our company Infra QA team recorded the menu selection action with QTP: click Transaction from main menu, then click Buy menu item. But it failed while the replay in QTP. The QTP did click the Transaction menu but not the Buy menu item.
Here are the codes from expert view mode:
SwfWindow("XXX Desktop 8.0.0").SwfToolbar("_XXXForm_Toolbars_Dock_Area").DropdownToolbarTool "newMainMenu","&Transactions"
wait 3
SwfWindow("XXX Desktop 8.0.0").SwfToolbar("_XXXForm_Toolbars_Dock_Area").ClickMenuTool "newMainMenu,&Transactions","Buy|XXX.XXX.Forms.ScreenDataSet.ScreenLauncher,XXX.Forms.ScreenDataSet|Buy"
The Error message as below:
IG : The specified Tool [&Transactions,Buy|XXX.XXX.Forms.ScreenDataSet.ScreenLauncher,XXX.XXX.Forms.ScreenDataSet|Buy] does not exist.
Question: Any one have any ideas how to select the menu item, thanks.
Hi Dwei,
I believe the issue may lie in the key name. Perhaps I am wrong, but is looks like you're key name for the buy menu tool is : "Buy|XXX.XXX.Forms.ScreenDataSet.ScreenLauncher,XXX.Forms.ScreenDataSet|Buy"
First I would try to confirm with your developer that that is the actual key. If it is, I imagine the reason it may be failing is the comma in the key name. Currently the comma is hard coded as a separator and as such it is inadvertently seeing the tool as only XXX.Forms.ScreenDataSet|Buy instead of its full name.
When in doubt to make it run properly, you could always just switch that argument to an integer, which represents the zero based visible index. So in this case it should be zero. Also so that you remember what it is intending to click you can just leave the existing key as an inline comment by using a single pop quote (') .
Mike , thanks for your reply. We follow you commnet and made more details testing on this problems. FYI please.
Issue One.
The script of click sub menu 'PopupMenuTool1_2_1' is failed ! But in the process ,the menu ''PopupMenuTool1_2' seems should be successfully detect by the script.
Issue Two.
<=
SwfWindow("Form1_2").SwfToolbar("_Form1_Toolbars_Dock_Area_Top").DropdownToolbarTool "UltraMenuBar","PopupMenuTool1"SwfWindow("Form1_2").SwfToolbar("_Form1_Toolbars_Dock_Area_Top").ClickMenuTool "UltraMenuBar,PopupMenuTool1","PopupMenuTool1_1"
=>
We try to click the menu of 'PopupMenuTool1_1' it is failed . But it is in the same level with ''PopupMenuTool1_2' , right ?
In short , we think if the target menu in the last sub will make the script failed, and all the dropdown methods works well but always get failed in the line of ClickMenuTool (for this function we also tried to use integer value instead of text string but doesn't work ), do you have any ideas or comment for this ?
Thank you very much.
I am just going to start off with an assumption, that in this sample app, in which the key's for each tool is the same as the captions. Based on that with the image you are showing, the ClickMenuTool action will fail because there is no control called LabelTool1_2_1, its called PopupMenuTool1_2_1. Was this a recorded action or a hand coded one?
For future reference, when using this forum, it helps greatly if you state what release version and if possible what build of TestAdvantage that you are using. Also copying in the full error message text in stating how it failed, or how you are determining that it failed.
As these are toolbars, and one action requires the previous one to replay correctly it should also be asked did the previous DropDown complete successfully?
Thank you for your help. We are now using QTP 10.1 with Test Advantage 2009.2 since our product was based on infragistics 2009.2, and all the script is recorded QTP recognize the control as “LabelTool1_2_1” automatically instead of “PopupMenuTool1_2_1”. I could not find any controls called LabelTool1_2_1 by using object spy.
For the error message format is same as we show your in first posted page,the error occurred while it is moving to the line of ClickMenuTool action. We think the event of DropDown executed successfully then extended the sub menu ''.
Thanks.
Hello dwei,
Can you please send me a sample? Please ask your developers to create a sample so that I can run that sample on my end and reproduce the issue.
Hi Asma,
Sorry the delay, our devs still in building the sample application. Could you please send me your E-mail box and i will send you the application ASAP when i get the it .
Many thanks,
dwei.
Hey,
dwei did you get your problem resolved, coincidently I am working on automation of same application you have worked (as shown in first screenshot). As we are using this product in our system.
So your input will be very helpful for me.
You can write to me on davparveen@gmail.com
Thanks,
Parveen