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
1040
Issues when manipulating grids on multiple tabs of a group details form
posted

We have an application that has a group details form with three tabs that each contain a simple UltraGrid. I have an action in my test that clicks on each tab and (among other things) restores the default layout for the grid. When I run the entire action, it performs the Restore Default Layout on the first tab, but I get either a "General Run Error" or a "Key Not Found" error when it tries to restore the default layout on the subsequent tabs (I close the group details form and reopen it after performing the various checks on each tab).

Here is a sample of the code as recorded by QTP (the test fails on the Select "Restore Default Layout" line):

SwfWindow("Company Name").SwfWindow("GroupDetails").SwfTable("ultraGrid1").RightClick "0","0;GroupName"
SwfWindow("Company Name").SwfWindow("GroupDetails").SwfTable("ultraGrid1").SelectMultiple "","",""
SwfWindow("Company Name").SwfWindow("GroupDetails").SwfTable("ultraGrid1").ActivateRow "0"
SwfWindow("Company Name").SwfWindow("GroupDetails").SwfTable("ultraGrid1").SelectRow "0"
SwfWindow("Company Name").SwfWindow("GroupDetails").SwfWindow("SwfWindow").SwfToolbar("SwfToolbar").Select "Restore Default Layout"

If I run QTP from step and only execute the steps for each particular tab, the portion of the code for each individual tab can be executed without error. I've tried adding a Wait statement at various points, but it doesn't help.

I'm using QTP 9.2 with TestAdvantage 2006 v2 CLR 1.x, so any help someone could provide will be appreciated!