Forum Discussion

A42700's avatar
A42700
New Contributor
14 years ago

Sliverlight navigation framework

I am having trouble with non-named/reused navigation buttons.



The developers are using the sliverlight navigation framework.  When they do this they do not name the objects and they reuse the navigation buttons.  TC cannot seem to tell the difference between the reused buttons.  I select the button on the first screen fine.  The application refreshed the screen and displays a reused navigation button.  TC sees the new button as as the original one and I cannot select it.  I do not see a way that I can map the reused button to a different mapped object, if I could I think that would solve my problem.



If more information would be helpful, just let me know.  



This has to be doable, my developers seem to think they are not doing anything usual. 



Thanks

Jay

1 Reply


  • Hi Jay,





    It is possible that you have a button (e.g. Next) mapped by a specific name (e.g. btnNext). When a new screen is opened in your application, a new button which is a copy of the original Next button is created and displayed. At the same time, the original button is not destroyed, but it is just made invisible.





    In this situation, when a TestComplete test works with the btnNext object for the first time, it searches for the Next button and assigns a reference to this button to the btnNext name. When the second screen is displayed, the test tries to access the btnNext object again. The tool sees that a reference to an object was already assigned to this mapping name and checks whether the referenced object is live. Since the old button exists, the tool does not try to search for the Next button again in performance reasons and try to use the old button. Since the old button is not visible, the test fails.





    If this is the case, you need to modify the mapping criteria of the btnNext object in order to make it reference the valid button. You can do this by adding the Visible or VisibleOnScreen properties with the true value to the mapping scheme of the btnNext object. Information on how to do this can be found in the Modifying Mapping Criteria help topic.





    Please note that in addition to the above step, you need to tell TestComplete to search for the Next button even if the btnNext object has a reference to an existing object. You can do this by calling the RefreshMappingInfo method for the btnNext object right before trying to access this object for the second time. You can find information on this method in the RefreshMappingInfo Method help topic.





    Please let me know if the above information helps.