Package com.abmash.api

Provides the main classes to control browsers and to find and interact with elements on the current web page.

See: Description

Package com.abmash.api Description

Provides the main classes to control browsers and to find and interact with elements on the current web page.

Example Application:

Browser browser = new Browser("http://example.com");       // open browser with specified URL
 browser.click("Contact");                                  // click on a link labeled "Contact" (case-sensitive)
 browser.type("Name", "John");                              // enter text into the textfield labeled "Name"
 browser.type("Message", "This is an example").submit();    // enter text into the textarea labeled "Message"
 HtmlElement successMessage = browser.query(headline(), has("Success")).findFirst();
 assertEquals(successMessage instanceof HtmlElement, true); // make sure that submit was successful 	
 

Abmash ("Automated Browser for Mashups") is a framework which allows the developer to directly interact with web applications as humans would do. The Browser.click(String) method simulates a click on any element. Further, it is possible to simulate keyboard interaction to enter text in an input field, or extracting content from specific page elements. The main classes of com.abmash.are Browser, HtmlElement, HtmlElements and HtmlQuery.

Browser is used to start a new browser session. Its main purpose is to find HtmlElements by using the Query methods, and interacting with them by using methods like Browser.click(String) or Browser.type(String, String).

An HtmlElement object is a representation of an HTML element on the current web page. It can be used to interact with them, to parameterize other browser interaction tasks or to get the contents of that element. Query.findFirst() returns an HtmlElement.

HtmlElements is a list of HtmlElement objects. It can be used to interact with them, to parameterize other browser interaction tasks or to get the contents of that elements Query.find() returns an HtmlElements object.

A Query contains of an arbitrary number of search conditions to find HtmlElements.

See Also:
Browser, HtmlElement, HtmlElements, Query, QueryFactory