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
2 answers

How to get log messages to display in Spock Reports?

I am using the Spock Reports extension in a Geb test. I am trying to find if there is any way to get the logging messages to display in the Spock report. I have something roughly like this: @Slf4j class SpockReportExample extends GebReportingSpec…
4
votes
2 answers

Chrome 60 enable logging in headless mode

I'm using Geb (Selenium & Webdrivers 3.40) with Chrome 60 on Windows 7 Enterprise. My GebConfig.groovy defines a chrome environment that configures Chrome with the following start arguments --headless --disable-gpu --disable-plugins --enable-logging…
saw303
  • 8,051
  • 7
  • 50
  • 90
4
votes
1 answer

Is Phantomjs session isolation still not working?

When I run my selenium tests using a chrome browser all my tests cases run fine. When using the phantomjs browser it would appear that the browser session does not get reset after each test case. In my tests cases, I log in as a user to then…
WontonJon
  • 413
  • 5
  • 14
4
votes
3 answers

Using CSS selectors to get first child from a nested element

I am trying to understand CSS selectors better and am fiddling around with Google/Gmail. When you go to Google's home page and enter "gmail", it will automatically present you with search results for that term. I want to write a CSS selector that…
smeeb
  • 27,777
  • 57
  • 250
  • 447
4
votes
1 answer

How to get a Geb module instance with its declared class?

Up to Geb version 0.10 the example code below has worked just fine: package whatever import geb.Module import geb.Page import geb.spock.GebSpec class ExampleSpec extends GebSpec { def 'MODULE - Y U NO HAVE THE RIGHT CLASS?'() { …
topr
  • 4,482
  • 3
  • 28
  • 35
4
votes
1 answer

Spock's @IgnoreIf Closure doesn't see System prop variable, set in jUnit's Suite

I Use Geb + Spock + jUnit runner + Maven My Specs are like: @Stepwise class My_Spec extends GebReportingSpec { @IgnoreIf({properties['sss'].contains('true')}) def "testFeature 1" (){ println ("--> Feature 1 runs") given: …
Uniqobot
  • 65
  • 6
4
votes
1 answer

Testing Angular dynamic page content (ng-if) with Geb

I am trying to test if an Angular ng-if element is visible or not using Geb. So far I've attempted to test if the displayed property is true or false as follows. Angular:
Text to…
dshgna
  • 812
  • 1
  • 15
  • 34
4
votes
2 answers

Quit driver after each Geb Spock test

I am running Geb/Spock tests in Sauce Connect, and I would prefer to have unique instances of the RemoteWebDriver per test. This way, the Sauce reports would be divided by test, which makes it easy to diagnose failures. I'm not concerned (right…
jonsie_araki
  • 221
  • 3
  • 8
4
votes
1 answer

Geb/Selenium tests hang loading new page

My Selenium tests frequently hang indefinitely on CI, always at an attempt to load a new page in driver.get. I am using PhantomJS 1.9.8. After several rounds of debugging, I think I've traced the problem to the webpage load not completing in…
wrschneider
  • 17,913
  • 16
  • 96
  • 176
4
votes
1 answer

Handle redirects and implicit at assertions

The website I want to test has a landing page which asks you to chose a language. You can skip this question by adding an extra parameter in the url. I want to test this behaviour with Geb and Spock as testing framework. So I have the landing page…
ChristopherS
  • 853
  • 4
  • 16
4
votes
5 answers

Run Geb tests on Jenkins

I've written some functional tests for my Grails app using Geb. I've configured my tests identically to this example project, which allows you to specify a list of browsers that the tests may be run against. The tests pass when I run them locally…
Dónal
  • 185,044
  • 174
  • 569
  • 824
4
votes
1 answer

How to navigate back in browser's history in Geb test

Inside a Geb test, I'd like to navigate back in the browser's history (ie. to click the browser's back button). I haven't found a way to do it using Geb API. What I do is: driver.navigate().back() // usage of WebDriver…
Tomas Pinos
  • 2,812
  • 14
  • 22
4
votes
2 answers

How to get the text of /html/head/title element using Geb framework?

Using the Page Object pattern, I'd like to implement some "at" verifications based on the text of /html/head/title element. How do I get the text of the title? I know Geb doesn't support XPath expressions.
Tomas Pinos
  • 2,812
  • 14
  • 22
4
votes
2 answers

executescript not working with InternetExplorer driver (Selenium)

For some reason, I cannot execute any javascript using "executescript" when I run my functional tests through IE. It works with Firefox. I have searched several hours on google with no luck. I am simply calling…
jcd
  • 221
  • 4
  • 15
4
votes
1 answer

How do I check if Geb Module "content" is present?

I'm a bit new to the whole Selenium/Geb thing, so I'm probably going about this a bit wrong, but I'm trying to get the exists() method in the following code to work properly. class Question extends Module { static base = { $("fieldset") } …
Zach Lysobey
  • 14,959
  • 20
  • 95
  • 149