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
4
votes
1 answer

geb using grapes - download failed: commons-codec#commons-codec;1.6!commons-codec.jar

I'm trying to run geb using the grab examples in the user guide for pulling in dependencies: $ cat my.groovy @Grapes([ @Grab("org.gebish:geb-core:0.9.2"), @Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.26.0"), …
Chris Snow
  • 23,813
  • 35
  • 144
  • 309
4
votes
3 answers

Can the Geb baseUrl navigation be used with subdomains?

I'm using Geb to write some browser automation tests. It allows you to configure a baseUrl and specify browser actions relative to this, as detailed in The Book of Geb. This works nicely for paths within the site but I can't see any syntax for…
Chris
  • 99
  • 1
  • 4
4
votes
2 answers

How can I get WebDriver to dismiss a Firefox Security Alert?

I am writing a test script using spock, geb, and WebDriver. The script submits a form on an insecure page. The page submits to a secure HTTPS URL. Firefox shows a warning for this, specifcally: This causes the following…
Adam
  • 43,763
  • 16
  • 104
  • 144
3
votes
2 answers

Geb - IncompatibleClassChangeError

I'm just starting out with Geb and am encountering this error when inputting sample code from the Book of Geb: import geb.Browser Browser.drive { go "http://google.com/ncr" // make sure we actually got to the page assert title ==…
hnaderi
  • 409
  • 8
  • 16
3
votes
0 answers

LocalFileDetector can't find uploaded files in Selenium Grid tests

I'm using Selenium Grid to run some automated tests that always worked locally. I've created a RemoteWebDriver object, and used remoteDriver.setFileDetector(new LocalFileDetector()) to activate the local file detector. All of the pages I can find…
3
votes
1 answer

How do you get the sessionFactory in a Grails Geb/Spock test case?

I think I need to flush the hibernate session in a GebSpec test, and so I want to get the sessionFactory. It looks like it should be injected but when I do something like this:- class MySpec extends GebSpec { def sessionFactory ... def "test…
pmc
  • 1,005
  • 1
  • 10
  • 18
3
votes
2 answers

Encapsulating Logic in Pages using GEB and Cucumber

Using GEB I was using the Page Object Pattern to encapsulate information about the different pages statically. I then refactored my GEB code to be used from a separate class so I could encapsulate common commands using method calls. For example I…
DeliveryNinja
  • 827
  • 2
  • 12
  • 28
3
votes
2 answers

What is the difference between Geb and Spock testing frameworks

I'm new in the area of software developing, and want to extend my knowledge over automation testing. I read a lot for Geb and Spock testing frameworks, but did not come to the conclusion for what purpose are they. Am I correct: Geb is for Page…
Yan Kennedy
  • 33
  • 1
  • 3
3
votes
1 answer

WebElement clear function doesn't clears the input values in some cases

I'm setting up a geb automation front-end test which requires me to clear the input values and set new values. I use WebElement clear method but it works for some input element but doesn't for some. I use following code as a work around which may…
3
votes
0 answers

Single quote in double quote test name of Spock test leads to 'unexpected token', BUT only when run with gradle and as isolated test

I just installed intellij and downloaded the geb-example-grade (https://github.com/geb/geb-example-gradle). In Intellij settings I configured under gradle/runner: Run test using: Let me choose per test. Then I ran the test "can get to the current…
3
votes
1 answer

Grails 3 integrationTest "No Session found for current thread" when GEB tests included

I am using Grails 3.3.1 and I am getting a "No Session found for current thread" error when running all of my integration tests using the Gradle "integrationTest" command. I have several service integrations tests which run fine on their own.…
Tabbykat
  • 41
  • 2
3
votes
2 answers

How to verify entire content of Geb module using Spock at once without asserting each element individually?

I have a Module with content defined for each element on the webpage I am working with: package com.abc.modules import geb.Module class Member extends Module { static content = { // Member fields mbrID {$("div.subject-details…
Marco S.
  • 61
  • 5
3
votes
1 answer

Is there any egde webdriver documentation about preferences?

I am currently trying to create cross-browser automated tests with Geb but I cannot find any documentation about preferences with Edge. What I am trying to do is to set up my Edge environment to automatically download documents and save them in…
Saub
  • 47
  • 6
3
votes
1 answer

Unable to load class get.spock.GebSpec due to missing dependency org/spockframework/mock/MockController

What is wrong with my test framework, that I cannot run my test? my build.gradle version '1.0-SNAPSHOT' //task wrapper(type: Wrapper) { // gebVersion = '0.13.1' // seleniumVersion = '2.52.0' // // distributionUrl =…
3
votes
1 answer

How to set a cookie in Geb / Selenium with PhamtomJS

How do you set cookie in Geb ? I'm running into the following error with the given example: org.openqa.selenium.InvalidCookieDomainException: {"errorMessage":"Can only set Cookies for the current domain" .... .. Ive also tried explicitly setting…
vicsz
  • 9,552
  • 16
  • 69
  • 101