How would you filter by the "class" attribute since class is a restricted keyword in C#?

Nov 27, 2012 at 12:24 AM

Example:

var sut = Browser.Find<HtmlDiv>(new
  { 
      class = "classvalue
  }
);
Coordinator
Nov 27, 2012 at 2:54 PM

Try

var sut = Browser.Find<HtmlDiv>("class", "classvalue");

 

The Find<T>(string,string) method is handy when you want to search or filter on attributes not defined in the PropertyNames Collection of the Control http://msdn.microsoft.com/en-us/library/ee672036.aspx