Jauntium adopts the design philosophy and naming conventions of Jaunt, making it easy to transition. Although Jauntium is generally the more powerful library, Jaunt remains more suitable in cases where Javascript support is not required and where instead the prime concern is speed of execution and/or access to lower level constructs (HTTP Request/Response).
The table below outlines the major differences between Jaunt and Jauntium:
Jaunt | Jauntium | |
---|---|---|
Browser | Automate Jaunt browser only | Automate any modern browser |
Javascript | JS disabled in browser | JS enabled in browser |
Browsing Modes | Headless browser only | Browser window or Headless browser |
WebPage loading | Browser loads HTML file only | Browser loads all page content |
Ultrafast browsing | Yes | No |
API supports custom HTTP Requests | Yes | No |
API provides access to Response Headers | Yes | No |
API provides JSON querying | Yes | No |
Dependencies on other software | None | Requires Selenium, Jaunt |
Jauntium enables your programs to work with tables and forms without relying on XPath or CSS-selectors that are cumbersome or can break when page structure/style changes. Instead, form fields can be targeted based on how they are visibly labelled, or even simpler, filled-out from start to end by specifying a sequence of input data. When working with tables, cells or columns can be targeted based either on matching text (labels) or indexes. Using labels as locators aligns with how end-users locate data elements on the page, and is therefore a beneficial approach when writing automated tests.
Another area of improvement is in the area of DOM access. Searching for elements is accomplished using a tagQuery, which resembles HTML and is therefore readable and intuitive. Search methods can be chained together and throw informative exceptions that free the developer from performing explicit error checking for null return values. Class Element provides a number of accesor methods that are absent or are poorly presented in Selenium (for children, parents, siblings, and attributes). Jauntium also extends Selenium's coverage with Class Node, which provides accessor methods for child/sibling nodes, such as comments and text nodes.
In addition, Jauntium provides high-level components for common web-scraping tasks. For example, the Table component allows you to extract text data from a row, a column, or multiple columns with ease, either by specifying row/column indexes or by using regular expressions match text in a target cell/column. Another example is the Document object, which supports pagination discovery, making it easy to iterate through multiple pages of database/search results.
An existing Selenium project can be easily enhanced with Jauntium, either in whole or in part - so you can start experimenting before you commit to making large changes. In terms of modifying your existing code, you can convert any existing Selenium WebElement to a Jauntium Element by using Browser.wrap(WebElement). A Jauntium Element implements WebElement, so you can use it anywhere you would normally use a WebElement. The Browser object itself is straightforward to instantiate, since you can pass your existing WebDriver object into the constructor for Browser. In this way, Jauntium can be used as a thin and versatile wrapper at particular points in your Selenium project, wherever you find it useful.
Support, discussion, etc. is available at the Jauntium Google Group.