Questions tagged [geb]

Geb is a library for headless web browsing on the JVM, suitable for automation and functional web testing. It uses Groovy to provide a concise story-like DSL for defining steps, and a concise and manageable DSL for defining page structure using the page object pattern.

Geb is a library for headless web browsing on the JVM, suitable for automation and functional web testing. It utilises the dynamic language features of Groovy to provide a concise story-like DSL for defining steps, and a concise and manageable DSL for defining page structure using the page object pattern.

Geb is based on the automation framework WebDriver and it can be used for scripting, scraping and general automation — or equally as a functional/web/acceptance testing solution via integration with testing frameworks such as Spock, JUnit, Selenium & TestNG.

822 questions
3
votes
1 answer

Learning geb and Spock for Mobile app

I am new to automation and wanted to learn geb for mobile with page objects. I have knowledge of page objects in geb. I just wanted to know from where to start writing test case. I am confused at getBrowser() and where to set the capabilities.
3
votes
3 answers

How to call method from any other page without declaring method as static using GEB and Spock?

I want to use following function in 2-3 pages so i want to call that function but getting exception "static method is required..." Here in Code CommonFunction is a class which extends Page Class def "User clicks on My Account Link"(){ …
Sujata Dwivedi
  • 131
  • 2
  • 9
3
votes
2 answers

Setting page url dynamically in Geb

In this scenario, I want to navigate from the main page to the sub page and perform some actions. The url of the sub page is dynamically generated, but the page content is the same. This is what I have tried so far: In the main class: to MainPage …
dshgna
  • 812
  • 1
  • 15
  • 34
3
votes
1 answer

Why does my Geb test return "failed to create driver from callback" even after updating my Selenium dependency in Grails?

I am referencing this previous thread (geb.driver.DriverCreationException: failed to create driver from callback) - but am still having problems. I am trying to run Geb functional tests under Grails 2.4.3 and I have my Selenium support dependency…
ry1633
  • 453
  • 1
  • 10
  • 24
3
votes
1 answer

Reuse of test-Classes in other tests

I want to make a few Tests which have a specific dependecy on each other. Because of this, I have one "main"-Test, which should call the other tests. Here are two example classes: @Stepwise public class TestClass extends…
GaNew
  • 33
  • 4
3
votes
1 answer

Does geb rollback the database to its virgin state after every each test?

I've been getting my feet wet with Geb on Grails, but there's not a lot of documentation about how it behaves. For instance, how does geb handle rollbacks? From what I'm observing, it runs the app and runs the test on the browser itself without…
3
votes
1 answer

How to download file with form submit using GEB

I'm building up a test in Geb (WebDriver) and need to submit a form which will create a file in response. I am able to download the file (the Browser save it automatically to the disk), but I wand to check it in GEB. I've tried withNewWindow(), but…
fmi
  • 163
  • 1
  • 7
3
votes
2 answers

Linkage error with geb

I'm attempting to just try a basic geb script, unfortunately I seem to be having some serious issues getting this off the ground. I'm using IntelliJ, I've downloaded the geb-core jar from http://mvnrepository.com/artifact/org.gebish/geb-core/0.9.1,…
dkirlin
  • 315
  • 4
  • 19
3
votes
4 answers

How to refactor common Geb test sequences

Suppose I have multiple Geb/Spock tests that beings with logging in. For example: @Stepwise Class AddNewPictureSpec extends GebSpec { def "User at login page"() { given: "User beings from login page" to LoginPage } def "User gets…
user3240644
  • 2,211
  • 2
  • 24
  • 35
3
votes
3 answers

General Problems With Geb (StaleElementReferenceException & Wait Timeouts)

According to the "Book of Geb" I started to map our portal's web pages. I prefer to use variables defined within static content closure block and accessing them afterwards in page methods: static content = { buttonSend { $("input", type:…
AndyDoe
  • 31
  • 1
  • 6
3
votes
3 answers

How to select the inner elements' text in GEB?

I have the following scenario:
3
votes
3 answers

Geb: Waiting/sleeping between tests

Is there a way to wait a set amount of time between tests? I need a solution to compensate for server lag. When creating a record, it takes a little bit of time before the record is searchable in my environment. In the following code example, how…
Szuturon
  • 931
  • 4
  • 17
  • 28
3
votes
3 answers

How do I test that the page has reloaded when I click a link to the current page?

I have a strange bug I'm trying to re-create with a test. I know what's causing the bug and how to fix it, but I can't figure out how to test it properly. Scenario: My browser is on http://example.com/foo I click a link on that page with…
BenLanc
  • 2,344
  • 1
  • 19
  • 24
3
votes
1 answer

windows 7 command prompt run grails functional testing with geb and spock

I can't seem to run functional tests from the command prompt. Interestingly it works fine with Intellij... I am using Grails 2.2.0, seleniumVersion = "2.27.0", spockVersion = "spock-grails-support:0.7-groovy-2.0", geb = "0.9.0-RC-1",…
Calahad
  • 1,408
  • 14
  • 22
3
votes
2 answers

Cannot set Input text field using AnglurJS and Geb

I am using Grails and AngularJS in a webapp. To test, I am trying to use Geb (a groovy wrapper around selenium / webdriver). I am having difficult setting an input text field. Here is my pageclass. class CartReviewPage extends Page { static url…
More Than Five
  • 9,959
  • 21
  • 77
  • 127