Innovation in Visual Studio 2010 for Automated Testing
Monday, June 21st, 2010A big innovation in Visual Studio 10 is the opportunity to wait for a UITestControl object to be opened or enabled before the rest of the test continues with executing. It can be very important if we test a project on a few different environments. In the previous versions, we used loops for checking the availability of the object, or we just made the process sleep for a while. Now, we can do the same with the following methods:
UITestControl::WaitForControlExist Method
public: bool WaitForControlExist()
Return Value is Type: System::Boolean. It is true if this control exists before the time-out, otherwise, it is false.
UITestControl::WaitForControlExist Method (Int32)
public: bool WaitForControlExist(int millisecondsTimeout)
Parameter is millisecondsTimeout, Type: System::Int32 and represents the number of milliseconds before time-out.
Return Value is Type: System::Boolean. It is true if this control exists before the time-out, otherwise, it is false.
UITestControl::WaitForControlEnabled Method
public bool WaitForControlEnabled()
Return value is Type: System.Boolean. It is true if this control is enabled before the time-out, otherwise, it is false.
public bool WaitForControlEnabled(int millisecondsTimeout)
Parameter is millisecondsTimeout, Type: System::Int32 and represents the number of milliseconds before time-out.
Return value is Type: System.Int32. It is true if this control is enabled before the time-out, otherwise, it is false.



