Can i refresh UIMap object ?
Problem is I change the location of UI element on and I again try to get the AutomationElement at that time I get AutomationELment but its BoundingRectanle is infinity.
So i am assuming that it is not refreshing the UIMap object.
Can anyone please help me on this ?
In the UIMaps section of your test, you have probably something like:
This creates a singleton for the UIMap object the first time it is used. To refresh it, you can make set the uiMap object to null, so it gets reinitialized again when it is used the next time:
Whenever you want to refresh the UIMap (get a new instance to it) call this RefreshUIMap method.
EDIT:
After reading your question again, I think you want to refresh a single Object in the UIMap and not the UIMap object instance. Select the object in the MyTestUIMap.uitest (assuming you have FeaturePack 2 installed), select
Search Configurationfrom the object properties and add the configurationAlwaysSearch. Whenever the object is used in your script, the testrunner will search for it again on the screen instead of trying to get it from the buffer.