Replies
It looks like one of the numeric arguments for GetCellData is not correct. If "2;0" is returning "Test2", then try changing either the "2" to "3" and/or the "0" to "1" and see if that returns the expected value (see the QTP Help file for an example).
Try using "GetROProperty ("Text")" instead of "GetVisibleText".
I don't know if this explains your issue, but according to the QTP Help, "The GetVisibleText method may behave differently in different run sessions depending on the operating system version you are using, service packs you have installed, other installed toolkits, the APIs used in your application, and so on. Therefore, when possible, it is highly recommended to use the GetROProperty method or the Object property to retrieve the value of the text (or equivalent) property from an object in your application instead of using the GetVisibleText method."
I hope this helps.
I'm not sure if this is the same situation as you're dealing with, but we've had instances when we had to do some descriptive programming to get QTP to interact with the controls the way we wanted.
For example, when we wanted to right-click on an ultragrid and select an option from the Context Menu, we had to use the SendKeys method so that QTP would "press" the Down Arrow key the desired number of times to select the option we wanted. Here's an example:
Dim WshShell
SwfWindow("Company").SwfWindow("Report").SwfTable("ultraGrid1").RightClick "2","0;ItemSize"
set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys "{ENTER}"
SwfWindow("Item Summary").SwfWindow("SwfWindow").SwfToolbar("SwfToolbar").Select "Restore Default Layout"
We're using TestAdvantage 2006 Volume 2 CLR 1.x and were eventually able to install a Hotfix from Infragistics that allowed us to perform the right-click without using the SendKeys method:SwfWindow("Item Summary").SwfTable("ultraGrid1").RightClick "2","0;ItemSize"
Wait 1
SwfWindow("Item Summary").SwfWindow("SwfWindow").SwfToolbar("SwfToolbar").Select "Restore Default Layout"
We never had an instance when we needed to select a level beyond the first level of the Context Menu, but we did find that it was necessary at times to add a Wait statement between the "Right-Click" and the "Select" to give the Context Menu time to expand and make the desired selection.
I hope this helps in some way. Let me know if you need further explaination.