These are all attributes that get added to the rendered html tag (disabled="disabled" for instence). You will need to get a collection of the attributes (HtmlElementAttributeReader) for that element and then verify using those. Bellow is some code showing
how to get the HtmlElementAttributeReader for an element.
HtmlPage page = new HtmlPage("SomePage.aspx");
HtmlElement element = page.Elements.Find("ControlID");
HtmlElementAttributeReader reader = element.GetAttributes();
//Some common attributes are strongly typed properties
Assert.AreEqual("Expected", reader.Class);
//Other attributes are indexed through the collection
Assert.AreEqual("Expected", reader["disabled"]);
Matthew M. Osborn
http://blog.osbornm.com
http://www.codingqa.com
http://weblogs.asp.net/asptest
"Change the world or go home."
osbornm
Participant
914 Points
196 Posts
Microsoft
Re: Testing control properties
Feb 16, 2009 05:18 PM|LINK
Hey Srhone,
These are all attributes that get added to the rendered html tag (disabled="disabled" for instence). You will need to get a collection of the attributes (HtmlElementAttributeReader) for that element and then verify using those. Bellow is some code showing how to get the HtmlElementAttributeReader for an element.
http://blog.osbornm.com
http://www.codingqa.com
http://weblogs.asp.net/asptest
"Change the world or go home."