Wednesday, 18 July 2012

How To Use Regular Expression In Element Propeties Values using Visual Studio 2010 Coded UI

Question: I have a object in my application whose id values is get dynamic:

this. muTextButton.SearchProperties[HtmlEdit.PropertyNames.Id] = "abc_yu2112121_ty56_hjhjh";

In the string "abc_yu2112121_ty56_hjhjh", following text is dynamic "yu2112121_ty56"

How can i handle this through regular expression or let me know if there is some other to handle this issue.

Answer:

Try This:

this.muTextButton.SearchProperties.Add("Id","abc_", PropertyExpressionOperator.Contains);

In this moment, there is no way to use regular expressions in the search properties.

1 comment:

  1. Please vote for the implementation of this feature:
    https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/5520782-regularexpression-in-searchproperties

    ReplyDelete