NUnitAsp

HtmlButtonTester Members

HtmlButtonTester overview

Public Instance Constructors

HtmlButtonTesterOverloaded. Initializes a new instance of the HtmlButtonTester class.

Public Instance Properties

AspId (inherited from ControlTester) The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) A temporary hack--this method WILL GO AWAY!
Description (inherited from HtmlTagTester) A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Text Get the text on the button
Visible (inherited from HtmlTagTester) Returns true if the tag is visible on the current page.

Public Instance Methods

Attribute (inherited from HtmlTagTester) Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester)Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester)Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Click Click the button.
Equals (inherited from Object)
GetHashCode (inherited from Object)
GetType (inherited from Object)
HasAttribute (inherited from HtmlTagTester) Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) True if the control is disabled.
Tag (inherited from HtmlTagTester) The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object)
IsPostBack (inherited from ControlTester) Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object)
OptionalPostBack (inherited from ControlTester) Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester)Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester)
GetChildElementHtmlId (inherited from ControlTester) Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester)
Submit (inherited from ControlTester) Post the form containing this control to the server.

See Also

HtmlButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace