Possible to search for "contains" search properties?

Aug 5, 2011 at 1:41 PM


In our current CodedUI project we use the "contains" search method a lot. So instead of matching an exact href URL, we search if it contains a specific value (because the beginning of our URL contains environment and language -specific information). Does the CUITe support this?

Aug 6, 2011 at 4:43 AM

Since CUITe is based on CUIT, you will be able to use the existing methods and extensions that CUIT provides.

From a CUITe control, use the UnWrap method to get access to the underlying CUIT control.

Aug 8, 2011 at 12:45 PM
Edited Aug 8, 2011 at 12:46 PM

Define the object/control as below in the object repository class. This means that the uniquely identifiable attributes of the button are available only at run time (dynamically generated), and it has a pattern.

public CUITe_HtmlButton btnSelect= new CUITe_HtmlButton("*");

In the test case code, you can set the regex search property ('contains' search property).

pgInviteBulkUsers.btnSelect.SetSearchPropertyRegx("name", "sl_");

You can also use .UnWrap() as icnocop suggested, but the above approach looks clean.

pgInviteBulkUsers.btnSelect.UnWrap().SearchProperties.Add("name", "sl_", PropertyExpressionOperator.Contains);