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

New Headless Chrome in Geb

I'm trying to get my project that uses Geb to run the beta channel of Chrome in headless mode. I can reproduce the issue using the Geb Gradle example project. In GebConfig.groovy, I've got this block to define chrome: environments { // run via…
jonnybot
  • 2,435
  • 1
  • 32
  • 56
6
votes
2 answers

Is there a way to prevent Geb from returning null from void methods?

In a Spock Specification any line in expect: or then: block is evaluated and asserted as boolean, unless it has signature with return type void. I've noticed that there is something odd going on for methods declared as void on any class inheriting…
topr
  • 4,482
  • 3
  • 28
  • 35
6
votes
1 answer

Jenkins Cannot run program "Xvfb": java.io.IOException :no such file or directory

I'm trying to run grails geb/spock tests on jenkins. I install Xvfb Plugin https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Plugin. Jenkins configurations: Project configuration: Exception:
Oleg Baranovsky
  • 368
  • 5
  • 22
6
votes
3 answers

Geb: how do I select a value from a dropdown?

I'm having great difficulty with one piece of my Geb test; how to select a value from a dropdown. I've tried it four different ways, and none of these work. It will either crash the test or skip right over it. Any help would be appreciated HTML…
ry1633
  • 453
  • 1
  • 10
  • 24
6
votes
1 answer

Composing Geb pages with Groovy traits

I have a responsive site and would like to separate out the concerns of whether parts of my page template are collapsed from the main content per-page: trait DesktopPage { static content = { header { $('nav', id:'nav-container') } …
chrylis -cautiouslyoptimistic-
  • 75,269
  • 21
  • 115
  • 152
6
votes
1 answer

Set request header and User Agent in Geb

When using Geb, is it possible to set custom request headers and user agent when using the Browser API (and not the Direct Download API)? While this is possible with the FirefoxDriver (see here), I am looking for a way of doing this with the…
Behrang
  • 46,888
  • 25
  • 118
  • 160
5
votes
1 answer

I can't run a simple Grails functional test using Geb and spock

I'm asking for help because I don't know what to do with this error... So first of all let me show the stacktrace I get when running my really simple test, what is weird is that my test doesn't seem to be executed ... ? I'm using Grails…
Jean-Baptiste
  • 387
  • 3
  • 11
5
votes
2 answers

Groovy can i dynamically execute a string as groovy command?

I would like to dynamically execute a groovy statement from my database. I'm currently using geb (www.gebish.org) to automate my browser and i would like the use "css selectors" from my database. For example: Browser.drive { go "www.test.com" …
lawiet
  • 57
  • 2
  • 5
5
votes
1 answer

Select client certificate for authorization in Chrome headless mode

I'm trying to run tests in headless Chrome using Geb. Before enter the page, I have to select client certificate for authentication. How to do this in headless mode? Robot class not working without UI. Is there any way to handle certificate…
caterso
  • 51
  • 1
  • 3
5
votes
1 answer

Can I check non-html responses in geb?

Geb is a nice framework for testing web applications, as there is very direct support for checking specific DOM elements as seen by the browsing client. However, sometimes the expected result of a request is plain text (or csv, json, etc). Is there…
Rasmus Kaj
  • 4,224
  • 1
  • 20
  • 23
5
votes
5 answers

Is it possible to log spock feature method names and clause labels?

I'd like to be able to log the spock feature names and clause labels when running some automated tests. This would help with debugging test issues when using a headless browser for automation, specifically phantomjs. Reason being, phantomjs does not…
WontonJon
  • 413
  • 5
  • 14
5
votes
1 answer

Geb + Groovy select custom element with a dash in the attribute name

I am trying to use the Geb jQuery selector on the following element:
  • <'li> I have tried the following: //1 $("li", "data-title": "Something") //2 $("li", data-title: "Something") But neither work. Is this possible?
  • jdfolino
    • 307
    • 2
    • 14
    5
    votes
    1 answer

    GEB find first visible element

    I have got some hidden buttons on the page. When I click on text input, one of these buttons shows on the page. Before:
    shmakova
    • 6,076
    • 3
    • 28
    • 44
    5
    votes
    2 answers

    Error running Cucumber Geb tests in IntelliJ IDE using groovy

    I am getting following error when running Geb tests in IntelliJ IDE. org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: features.step_definitions.MyHomeStepDef.to() is applicable for…
    Shabar
    • 2,617
    • 11
    • 57
    • 98
    5
    votes
    2 answers

    Could not generate test report in gradle due to cucumber step syntax

    I get following error message when I tried to run tests in command line. Tests are based on Geb, Selenium and Cucumber/Groovy. Caused by: org.gradle.api.GradleException: Could not generate test report to 'D:\Folder\ABCD\Auto\build\reports\tests'. …
    Shabar
    • 2,617
    • 11
    • 57
    • 98
    1
    2
    3
    54 55