The goal of Abmash is that programmers do not need any knowledge about the HTML/CSS source code of web pages. Instead, elements can be found by querying visual attributes and visible text.
This is a short example of a minimal Abmash application:
// open new browser window and visit Google
Browser browser = new Browser("http://google.com");
// type "Abmash" in search field and submit it
// "google" is the visible label of the input field (you could use "search" or "lucky" too, if you use Google in English)
HtmlElement searchField = browser.type("google", "Abmash").submit();
// find the first result containing "github"
HtmlElement firstResult = browser.query(
headline(),
link("github"),
below(searchField) // alternative: below(typable("google"))
).findFirstWithWait();
// finally click it and close the browser
firstResult.click();
browser.close();
Using the query methods requires a static import in your Java file:
// static import for abmash query methods (e.g. headline() or link())
import static com.abmash.api.query.QueryFactory.*;
Abmash comes with handy tools to interact with web pages.