HI,
I am trying sorting on UltraWinGrid Conrtol, Which is working fine in QTP9.2. But the Same code is not working on QTP 11 and thorwing the following Error:"Object Reference not set to an instance of an Object"
Sample Code:SwfWindow("xxx").SwfTable("xyz").Sort 0,"idTimeSlot","Ascending"
Please help me on this Issue.
It's hard to say exactly what the cause may be from that. It's seems like a generic null reference exception. Changes in QTP versions should not cause such an exception unless you are not using TestAdvantage and you are relying solely on the limited base support QTP has for NetAdvantage controls.
If you are using TestAdvantage, I also wouldn't expect the behavior to change if you only changed the version of QTP. So my thought is you also changed the version of TestAdvantage along with your version of QTP. If that is the case, if you could let me know which version you were using, and which version you moved to, it would greatly help in determining what the cause of the behavior is.
Hi Michael ,
Thanks for the response.
1. From my question a small modification we were using QTP 9.5 NOT QTP 9.22. We are Using Test Advantage 10.1CLR2.0 3. We have Just upgraded QTP Version from QTP 9.5 to QTP 11.0 and the Test Advantage Version Same as before i.e, Test Advantage 10.1CLR2.0
Please let me know if you requried any other Information
After looking at the code, there was a bug that was fixed in respects to the Sort method. The likely cause was how QTP handles Missing\Optional parameters changed from one release of QTP to the next. If the behavior is as I expect it to be, you should be able to correct the problem by adding the fourth parameter in. The fourth parameter is a boolean value that represents weather you want to extend the sorting or not, IE sort on the column supplied in addition to the previously sorted columns. To have it act as before, pass in a value of false.
If you would rather allow it to play with your existing scripts you will need to download the latest patch for that product.
Let me know if this resolves your issue,