Our automated test team uses common methods to interact with different types of WinForms controls in a standardizwed manner. Many of these methods include a call to EnsureVisible() to ensure access to the related GUI object before the methods take any actions with them (click, enter text, scroll, etc.).
These methods examine the EnsureVisible method's return value and record a warning when it returns False to make script debugging easier:
Code: Select all
if (!adapter.EnsureVisible())
{
Report.Warning("Could not make adapter (" + adapter + ") visible!\r\nWill try to process anyway.");
}
We cannot tell if the method is always failing (and our controls just happen to always be visible) or if the documentation is incomplete (e.g, the method also returns False if the control is already visible and the method doesn't perform any actions).True if the operation has suceeded.
We still have occasional cases where a script cannot interact with a control (like clicking a button) one time out of X. We need the ability to determine when and why this occurs. We thought EnsureVisible would give us this capability.
Is there a bug with the return value of EnsureVisible? Is the documentation complete as to when and why the methods will return True or False?
Our script development is taking place on Windows 7 x64 systems using Ranorex 3.1.3 and VS 2010. Our scripts interact with a WinForms application built using C#.NET in VS 2010. Both scripts and applications are compiled as AnyCPU and .NET 3.5(.1).