We have a new build of our software and we are using .Net 4 rather than the previous .Net 3.5. I am using QTP 11 to test it and when doing a SwfTable.Select cell it is causing the AUT to crash.
QTP 11 with the same AUT built with .Net 3.5 works fine.
HP are being fairly unhelpful and the best response they have managed to come up with is "Can you find another way of selecting a cell in a table?".
What is the best way to find out exactly what is going wrong in the application or QTP? I have tried using WinDebug against the AUT process but that seems to be causing the test machine to hang.
Obviously there's something about our Table object built in .Net 4 that doesn't get on with QTP but how can I find out what? In the QTP results it just gives a general error when selecting the table cell.
Sadly that didn't work. The table in question is a slightly customised .Net DataGrid. There is only a problem with it when it is built as .Net 4.0. QTP 11 and QTP 10 work perfectly if it is built as .Net 3.5 and no other changes.
We entcountered the same problems and also our DataGrid is slightly customised. Everything worked fine with QTP 11 and .Net 3.5, but when the application was upgraded to .Net 4.0, QTP 11 caused our application to crash.
For us the solution was to use the methods of the DataGrid itself (and not QTP's general methods).
So instead of:
<font color="blue"> SwfWindow(...).SwfTable(...).SelectRow <Rownumber> </font>
We now use:
<font color="blue"> SwfWindow(...).SwfTable(...).Object.CurrentRowInde x = <Rownumber> </font>
Interesting comments. I did look into using the internal methods to set the current cell but I can't seem to find a way to do it. I can select the row but not a specific cell.
Object.CurrentCell doesn't return an object so there is no way to tell it to set the current cell.
I tried to use DotNetfactory.CreateInstance to create a DataGridCell object and then do SwfTable.Object.CurrentCell = NewCell but while QTP didn't report any errors, it didn't actually select the cell either.
I may try to make the cell visible, get the cell bounds, then do a standard mouse click within the bounds and see if that works.
So far HP have suggested plenty of patches but been unable to solve the problem and it takes them a long time to get back to us when we respond that their fix didn't work.
If either of you guys get a solution, please let me know.