Object Browser sometimes not updating during Silverlight Out of Browser App testing
While trying to write tests again an out of browser SIlverlight application (v 5.1.50918.0), I'm finding that the object browser is sometimes not updating while clicking through the application, causing objects that I can see on screen to be not visible on screen in the eyes of TestComplete (v 14.40.1539 x64). The tests will fail because the objects cannot be found by TestComplete, even though I can clearly see them on my screen.
Adding a Sys.Refresh() each time I've run into the issue solves the problem, but I'm curious as to why this seems to be needed so often during these tests? The need for the Sys.Refresh() is different depending on who is running the test, as well. It's impossible to know if a test that runs fine on my machine will end up needing a Sys.Refresh() somewhere during the test when run on someone else's machine.
Solved! Go to Solution.
That's a good question for Support. Here's the link:
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
It's worth increasing the Auto-wait timeout project option. Also, instead of Sys.Refresh, it's better to use the WaitSlObject method to obtain the Silverlight object. You can find more recommendations on how to obtain long-loading objects here:
SmartBear Community and Education Manager
The problem is that the object is already there, just sitting around and waiting longer during the test doesn't change TestComplete being able to recognize that it is.
Response from SmartBear support included the following line, which seems to make sense to answer my question of why this happens:
"This issue typically occurs when an object in an application is already loaded into the application and is later made visible onto the screen. This issue can also occur if the object loads fully before becoming visible."
The best solution for our application is the Sys.Refresh(), we just have to be smarter about how we incorporate it into our tests.