Geb (testing framework)
| Original author(s) | Luke Daley, Marcin Erdmann |
|---|---|
| Developer(s) | Luke Daley, Marcin Erdmann |
| Stable release | 8.0.1
/ November 11, 2025 |
| Repository | github |
| Engine | |
| Type | Test framework |
| License | Apache 2.0 |
| Website | groovy |
Search Geb (testing framework) on Amazon.
Geb (pronounced "jeb") is a functional test framework for browser web applications. It is backed by the Selenium WebDriver. The tests are written in the Groovy programming language. The test code syntax uses Groovy DSL that allows describing Page Object models (entire pages and their modules) in a declarative style.[1]
The framework can be integrated with test engines such as Spock, JUnit, and TestNG.[2]
Selecting web content
The content of a web page is usually selected via the $ method, which returns an object of the Navigator class. Such an object can wrap one or more objects of the WebDriver WebElement interface and provides additional functionality. The method extends the functionality of the Selenium finders by adding advanced features. It uses the jQuery style, e.g., the call $("div", 3, title: "section") returns the fourth (indexing begins with 0) DIV element with a title attribute value of "section". The full method signature is $(selector, indexOrRange, listOfAttributeAndOrTextAndOrVisibilityMatchers).
A Navigator object can be created dynamic. For such navigators, the related DOM elements are refreshed whenever they are accessed.
Page object pattern support
Geb Page Object models can describe both entire pages and modules that can be shared among different pages, such as navigation bars and footers. The model classes extend the library Page and Model classes.
The special Groovy DSL supports the declarative style and uses nested code blocks in braces, reflecting the elements hierarchy.
Integration with other tools
As a WebDriver wrapper, Geb allows direct access to its functionality when needed. Also, since it implements the WebDriver protocol, it can be integrated with Appium to support mobile testing.
Spock, JUnit, and TestNG test engines can be used to run Geb-based tests. For better integration with Spock, Geb provides the special GebSpec class.
See also
- Selenium (software), an umbrella project for a range of tools and libraries aimed at supporting browser automation
- Spock (testing framework), a testing, specification, and mocking framework (test engine)
References
- ↑ Muschko, Benjamin (19 February 2014). Gradle in Action. Manning. ISBN 978-1-61729-130-2. Search this book on
- ↑ Fletcher, Rob (May 2017). Spock: Up and Running. O'Reilly Media, Inc. ISBN 978-1-4919-2328-3. Search this book on
Category:Cross-platform software Category:Java development tools Category:Java platform Category:Graphical user interface testing Category:Software using the Apache license
| Stub icon | This computer-library-related article is a stub. You can help EverybodyWiki by expanding it. |
This article "Geb (testing framework)" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:Geb (testing framework). Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.
