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

Geb-spock test can't select dd text

I am trying to test a page generated by a .gsp file. For that I need to access the text value of a specific field. The generated HTML looks like this:
No
The gsp…
Giannis
  • 5,286
  • 15
  • 58
  • 113
0
votes
1 answer

Geb_Spock tests integration with jenkins

How to integrate my geb spock tests with jenkins? I created a jar using gradlew build command but only 1kb jar file was created in which there are no .class files. My folder structure: src/test/groovy Build automation tool : Gradlew Framework:…
0
votes
1 answer

accessing Spring beans from a Geb test

I'm using Geb to write some functional tests for a Grails app. Is there a way to access Spring beans from such tests. I tried the obvious: import geb.junit4.GebReportingTest class AuthenticatedUserTests extends GebReportingTest { UserService…
Dónal
  • 185,044
  • 174
  • 569
  • 824
0
votes
1 answer

Cannot use HtmlUnitDriver in Geb-Spock Grails test because of dependencies problems

I'm trying to use HtmlUnitDriver in Geb-Spock functional test in Grails 2.3.7. I build project using Maven. When I run test using this driver I get: java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal I think I get this error, because I…
nuoritoveri
  • 2,494
  • 1
  • 24
  • 28
0
votes
1 answer

Drive two different browsers in one GebReportingSpec?

I'm using geb and spock for functional tests in my Grails 2.3.7 app. The app allows real-time interaction between users, which I'd like to test automatically. Does anyone know how, or if it's possible, to run two different browsers in one Spec? For…
Ken
  • 685
  • 2
  • 5
  • 11
0
votes
2 answers

Is it possible to customize gradle's test reports? (Integrate geb reports with gradle test reports)

I am using geb + spock + gradle for tests and I'd really like to integrate a link to geb's screenshots into the gradle report. For those not familiar with geb, essentially it organizes screenshots for each test into a folder structure that follows…
nerdherd
  • 2,508
  • 2
  • 24
  • 40
0
votes
1 answer

Login problems with headless firefox and Geb / Selenium

I have problem with a groovy (Geb) script accessing a website and it's login mechanism. On a Mac and a PC with non-headless Firefox all is working well. On a headless linux (Debian or Ubuntu) it does not work - I tried on a AWS micro & small as well…
Jörg Rech
  • 1,339
  • 2
  • 13
  • 25
0
votes
2 answers

How to find the row that contains a specific string in GEB and in that particular row I need to select a link/checkbox

Is there any way to find the row number/index that contains a specific string in GEB? I can check whether a row contains a specific string or not with: text: contains() But how can I find the index of that row and then click on a link in the same…
Sharif Mamun
  • 3,508
  • 5
  • 32
  • 51
0
votes
1 answer

Geb / Groovy - Page content not recognized when used within other Page Object method

When I click a button I have to wait for some dynamic content to be rendered. When I put the waitFor closure in the test it works correctly. However, I wanted to put the waitFor in a method inside the Page object so I do not have to always call…
user3517049
  • 826
  • 1
  • 6
  • 9
0
votes
1 answer

Geb to() is not working for Page List

I am trying to implement the to() checker on the Page Object for the case when clicking a button may stay on the page if there is an error or go to a new page if there are no errors. When I use a List to provide all the possible Page Classes only…
user3517049
  • 826
  • 1
  • 6
  • 9
0
votes
0 answers

Parametrize 'at' closure with arguments from script or spock specs

There is similar question, but without answer Customize 'at' with extra parameters for the closure? I want to reuse my page objects in different scenarios with different input and expected data. and since "at" method doesn't give me a way to…
user1582639
  • 161
  • 1
  • 11
0
votes
1 answer

How to run more than one test but not all the tests in GEB using Gradle?

I am running gradle to run the tests from Windows command line. What I do to run a single test is: gradlew.bat chromeTest -DchromeTest.single=test1Spec or for all the tests: gradlew.bat chromeTest If I try to run only two test classes like…
Sharif Mamun
  • 3,508
  • 5
  • 32
  • 51
0
votes
1 answer

Geb not responding to some websites

I am trying to accessing the url using gebish. Browser homePageBrowser = new Browser(driver: new HtmlUnitDriver()) HomePage.url = "http://edition.cnn.com/" homePageBrowser.with { to HomePage pageTitle = title } Here is the code of…
Jagadeesh
  • 570
  • 3
  • 11
0
votes
1 answer

Selenium Grid 2 from mac hub to windows node

I am setting up selenium grid to be able to test IE in a Virtual Machine. I am running into: geb.driver.DriverCreationException: failed to create driver from callback which generally means the driver is not being found. I'm pointing it to the…
TIMBERings
  • 361
  • 1
  • 4
  • 17
0
votes
1 answer

grails gebish testing loops / times

This is my gebish test and I don't know why it doesn't work. def "create 9 more names"(){ def i = 0 8.times{ $("button", value:"newCat").click() waitFor { $("input", name:"name") } $("input", name:"name") << "gebTest" …
Sagarmichael
  • 1,624
  • 7
  • 24
  • 53