I use the following line in my ClickLink method:
HyperLink.SearchProperties[HtmlHyperlink.PropertyNames.InnerText] = sLinkName;
However, one of my links contain a space at the end. I want to be able to search for this link without specifying the space.
For example, instead of using
ClickLink("Travel Agents ")
I want to use
and have the code do soemthing like the following:
HyperLink.SearchProperties[HtmlHyperlink.PropertyNames.InnerText] = sLinkName+"*";
Wild card search is not supported in CodedUI tests as far as I know.
You can accomplish what you are trying to do using PropertyExpressionOperator.Contains
Typical usage for your case would be like this:
<your object>.SearchProperties.Add("InnerText", sLinkName, PropertyExpressionOperator.Contains);
To realize that you do not understand is a virtue; Not to realize that you do not understand is a DEFECT.
--- Lao Tzu
Excellent solution! It works! Thanks very much.