Mapping objects with visual studios coded UI can be cumbersome and hard to manage one way to make your fame work a little lighter is to make a class that does this for you and even better creating a more generic method that will handle all the objects for you. The way I accomplish this idea is with the following code snippets
public T GetControlGeneric<T>(string propertyValue, string property, PropertyExpressionOperator propertyExpressionOperator = PropertyExpressionOperator.Contains) where T:WinControl
{
return GetControlGenericWithParent<T>(propertyValue, property, ThickClient, propertyExpressionOperator);
}
public T GetControlGenericWithParent<T>(string propertyValue, string property, UITestControl parent, PropertyExpressionOperator propertyExpressionOperator = PropertyExpressionOperator.Contains)where T:WinControl
{
T ctrl = (T)Activator.CreateInstance(typeof(T), new object[] { parent });
ctrl.SearchProperties.Add(property, propertyValue, propertyExpressionOperator);
return ctrl;
}
-Sarah
Friday, June 21, 2013
So you ran a coded UI Teast and Now IE isn't working
If for some reason you start to get the following error when you open IE
and you have recently ran a coded UI test try the following
-Sarah
and you have recently ran a coded UI test try the following
- Got to Internet options
- Click on the Connections Tab
- Click the lan settings btn
- And Uncheck the box "Use a proxy ect"
- Try to use IE Again
-Sarah
Thursday, May 2, 2013
So Your Coded UI Stopped Working and You Don't Know Why
If your coded UI test suddenly stopped working (the test can no longer find objects on the screen you keep getting null reference exceptions) your may be a victim of copy local =ture. If some one (or yourself) has been adding or removing the coded UI dlls they may have accidently set copy local to ture. To get you test back up and running you simply flip it back to false.
-Sarah
-Sarah
Subscribe to:
Posts (Atom)