Need For Speed: Storing objects and working with them
Posted: Wed Aug 27, 2014 12:14 pm
Hi,
Our project was little slow in identifying objects and working with them. We have xpaths and dont use Rx's object repository at all. All our objects are in an XML as xpaths.
Now we have methods to retrieve an object's xpath and search for that object in the application. This was taking time. So what we did?
Now we have a parent for all the objects. For example there are some objects under a container. This container becomes parent for these objects. We store this parent for future reference and keep looking for objects underneath it. This improved speed a lot since we dont look for these objects from the top every time.
We took it to next level, we stored the objects as well. This improved the speed even more.
Then came the problems. Rx was faster than our application. It started clicking on objects which are present in the dom but not yet drawn on the screen! We dont know how that happens but it happens. Sometimes the objects might have changed the states and the stored ones are not reflecting their new state.
So what we did? We put a refresh clause to search the objects from the top and get the latest object. This has solved a lot of our problems. But there is one unique problem around which we are not able to wrap our heads around it.
Here it is. The parent which we store is somehow holding on to old objects and our findsingle and tryfinds are failing.
Example:
storedparent.TryFindSingle("button"); // Fails Even though the button is there under the parent when we spy.
Can anyone tell us why the stored parent is holding on to old objects?
Our project was little slow in identifying objects and working with them. We have xpaths and dont use Rx's object repository at all. All our objects are in an XML as xpaths.
Now we have methods to retrieve an object's xpath and search for that object in the application. This was taking time. So what we did?
Now we have a parent for all the objects. For example there are some objects under a container. This container becomes parent for these objects. We store this parent for future reference and keep looking for objects underneath it. This improved speed a lot since we dont look for these objects from the top every time.
We took it to next level, we stored the objects as well. This improved the speed even more.
Then came the problems. Rx was faster than our application. It started clicking on objects which are present in the dom but not yet drawn on the screen! We dont know how that happens but it happens. Sometimes the objects might have changed the states and the stored ones are not reflecting their new state.
So what we did? We put a refresh clause to search the objects from the top and get the latest object. This has solved a lot of our problems. But there is one unique problem around which we are not able to wrap our heads around it.
Here it is. The parent which we store is somehow holding on to old objects and our findsingle and tryfinds are failing.
Example:
storedparent.TryFindSingle("button"); // Fails Even though the button is there under the parent when we spy.
Can anyone tell us why the stored parent is holding on to old objects?