See: Description
Class | Description |
---|---|
Browser |
Main class for using a browser instance and interacting with it.
|
HtmlElement |
Representation of an HTML element on the web page.
|
HtmlElements |
List of
HtmlElement instances. |
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)
.
HtmlElement
represents an HTML element on the current page.HtmlElements
is a list of HtmlElement
objects.Query
is used to find HTML elements on the current page.
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
.
Browser
,
HtmlElement
,
HtmlElements
,
Query
,
QueryFactory