We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Disposed Object KeyEnabledGrid

Hi,

When I'm running my QTP script, whenever i close a window and open the same window again i encounter this error:

Cannot access a disposed object.
Object name: 'KeyEnabledGrid'.

This happens to most grids of class SwfObject when i do SetCurrentCell. Is there a way to handle this or to "un-dispose" the object once it is disposed?

3 Replies

NR Nirmal Raja Syncfusion Team June 8, 2009 02:08 PM UTC

Hi,

Thank you for your interest in Syncfusion products.

Please let me know on how you close and open the window through the script, and is the issue occurs on recording? If you see the issue in replay as soon as you close and open the window, then it is caused due to the delay on QTP in retriving the swfobject which has been recreated after disposed. So to avoid it, as a workaround, you can set a delay after opening the window by calling a method called 'wait 5', which will wait until the grid swfobject has been created and then you can go for the functionality of SetCurrentCell or any methods.
Please send us a sample or try to reproduce it in our shipped samples if you still face the issue.

Regards,
Nirmal


KR krishna February 9, 2010 10:16 AM UTC

Hi,

I faced the same problem.

When i access the "HPSyncgrid" for the first time,It is working fine. When i try to repeat the same operation again(in For Loop),It is is throwing an error "Can not Access a disposed object : Objec name".

I dont think it is due to the wait time.

Can we do something witht the methods IsDisposed and ISDisposing.

Thanks,
Krishna


NR Nirmal Raja Syncfusion Team February 11, 2010 03:37 AM UTC

Hi Krishna,

Thank you for the update.

The control gets disposed when the application is closed, it will be created when it gets opened again, the QTP extensibility source don't have any chance of disposing the control object. It depends on the application on how it has been reinitiated. The IsDisposed method can be given in the source but it will skip the replay as the object has been disposed. Please let me know if you can send me a sample as we were unable to reproduce this issue, we can analyse the issue with your sample and get a solution.

Regards,
Nirmal

Loader.
Live Chat Icon For mobile
Up arrow icon