Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
305
How to use Menu items in QTP for infragistics .net application
posted

Hi,

I am using:

QTP 9.5 with: TestAdvantage for Windows Forms (HP) Version 2007 Vol. 3 CLR2.0

Application under testing has: NetAdavntage 2007 Vol. 3 CLR 2.0

I am automating an application  where i need to select "Connect" option from file menu. I have written the following code.


   SwfWindow("swfname:=xyz").SwfToolbar("swfname:=xyz").ClickToolbarTool "MenuBar","File"
   wait(2)
   SwfWindow("swfname:=xyz").SwfToolbar("swfnamexyz").ClickMenuTool "MenuBar,File","Connect"

This code works fine normally. But during execution of the script. if user interfare (moves the mouse during Run Time), some times the drop down menu is unable to appear and the script gets failed.

It happens for Context Menus too. When Right clicked at any node of a tree, and then clicking at the Context Menu items, sometimes during Replay, if user moves the mouse pointer then the script fails.

Can any body please suggest me any suitable alternative.

Also note that there is no toolbar buttons for connect and disconnect option  hence i have to use only File menu.

 

Please help in this as it's an urgent issue.

 

Thanks,

Nabajyoti

 

Parents
No Data
Reply
  • 310
    posted

    Hi,

    When I have had an issue with a menu item in the past (for example when QTP recorded a click on a particular menu item in an app I was working on, the menu item name returned was a massive long number - similar to a GUID - that changed evey time the appalication was opened), I have found that using keystrokes instead was a very stable alternative.

    For example, to open your connect menu it might look like:

    SwfWindow(oWin).Type micAltDwn + "c" + micAltUp

    That's assuming your menu items use keyboard shortcuts. I don't think you should be letting a user move the mouse during a test run anyway, and we have a dedicated computer for running automated tests to guarantee that doesn't happen.

    Cheers, Ryan

Children