I want to pass a property name as an argument:
protected T findControl<T>(string myProperty, string myPropertyValue , UITestControl control = null) where T : UITestControl, new()
{
var uiContainer = control ?? Window;
return uiContainer.SearchFor<T>(new { myProperty = myPropertyValue });
}
public static T SearchFor<T>(
this UITestControl control,
dynamic searchProperties,
dynamic filterProperties = null) where T : UITestControl, new()
I use:
return findControl<HtmlComboBox>("id", "PersonComboBox")
When debuging, I get:
dynamic searchProperties = {myProperty = PersonComboBox}
what, I would like to is:
dynamic searchProperties = {id = PersonComboBox}
Why is that so? Is there a way to fix that?