What's the Gradle task that you are running in CI?
On Tue, Oct 22, 2019 at 6:33 PM Ben Frey <[email protected]> wrote:
> My tests are working locally, although I have to use the bonigarcia
> WebDriverManager to retrieve a Chromedriver locally:
> WebDriverManager.chromedriver().version('2.35').setup()
>
> In my build.gradle file I want to set up an Internet Explorer browser in
> the remote SauceLabs instance:
> sauceLabs {
> browsers {
> create('internet explorer') {
> capabilities platform: 'Windows 7', browserVersion: '11'
> }
> task {
> }
> account {
> def username = System.getenv('SAUCE_USERNAME')
> def accessKey = System.getenv('SAUCE_ACCESS_KEY')
> }
> }
> }
>
> and my GebConfig.groovy looks like this
> baseUrl = 'https://www.domain.com'
> reportsDir = 'build/reports/tests/geb'
>
> def sauceLabsBrowser = System.getProperty('geb.saucelabs.browser')
> if (sauceLabsBrowser) {
> println 'Got a SauceLabs browser'
> driver = {
> def username = System.getenv('SAUCE_USERNAME')
> assert username
> def saucelabsKey = System.getenv('SAUCE_ACCESS_KEY')
> assert saucelabsKey
>
> new SauceLabsDriverFactory().create(sauceLabsBrowser, username,
> saucelabsKey)
> }
> } else {
> println 'Attempting to get a local webdriver'
> // WebDriverManager.chromedriver().version('2.35').setup()
> }
>
> When I push my code to my company's GitLab instance, I get the following
> stack trace:
> tests.TestClass > classMethod FAILED
> java.lang.IllegalStateException: The path to the driver executable
> must be set by the webdriver.chrome.driver system property; for more
> information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver.
> The latest version can be downloaded from
> http://chromedriver.storage.googleapis.com/index.html
> at com.google.common.base.Preconditions.checkState(Preconditions.
> java:847)
> at org.openqa.selenium.remote.service.DriverService.findExecutable
> (DriverService.java:134)
> at org.openqa.selenium.chrome.ChromeDriverService.access$000(
> ChromeDriverService.java:35)
> at org.openqa.selenium.chrome.ChromeDriverService$Builder.
> findDefaultExecutable(ChromeDriverService.java:159)
> at org.openqa.selenium.remote.service.DriverService$Builder.build(
> DriverService.java:355)
> at org.openqa.selenium.chrome.ChromeDriverService.
> createDefaultService(ChromeDriverService.java:94)
> at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.
> java:123)
> at geb.driver.NameBasedDriverFactory.getDriver(
> NameBasedDriverFactory.groovy:44)
> at geb.driver.CachingDriverFactory.getDriver_closure4(
> CachingDriverFactory.groovy:57)
> at geb.driver.CachingDriverFactory.getDriver_closure4(
> CachingDriverFactory.groovy)
> at geb.driver.CachingDriverFactory$SimpleCache.get(
> CachingDriverFactory.groovy:81)
> at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.
> groovy:56)
> at geb.Configuration.createDriver(Configuration.groovy:675)
> at geb.Configuration.getDriver(Configuration.groovy:353)
> at geb.Browser.getDriver(Browser.groovy:160)
> at geb.navigator.factory.BrowserBackedNavigatorFactory.<init>(
> BrowserBackedNavigatorFactory.groovy:31)
> at geb.Configuration.createNavigatorFactory(Configuration.groovy:
> 413)
> at geb.Browser.createNavigatorFactory(Browser.groovy:982)
> at geb.Browser.getNavigatorFactory(Browser.groovy:170)
> at geb.Page.init(Page.groovy:140)
> at geb.Browser.initialisePage(Browser.groovy:1116)
> at geb.Browser.createPage(Browser.groovy:829)
> at geb.Browser.to(Browser.groovy:537)
> at geb.Browser.to(Browser.groovy:526)
> at geb.spock.GebSpec.methodMissing(GebSpec.groovy:60)
> at login.LoginTrait$Trait$Helper.logIn(LoginTrait.groovy:7)
> at tests.TestClass.setupSpec(TestClass.groovy:8)
>
> So I have two questions:
>
> 1. Why is it trying to retrieve a Chrome webdriver in the CI pipeline
> when my buildscript specifies Internet Explorer?
> 2. Am I setting everything up as expected? I left out the
> sauceLabs.task closure because I was getting Gradle errors on e.g.
> test.testClassesDir
>
> --
> You received this message because you are subscribed to the Google Groups
> "Geb User Mailing List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/geb-user/7545c8f8-e510-4065-8d3c-7c29b67304b0%40googlegroups.com
> <https://groups.google.com/d/msgid/geb-user/7545c8f8-e510-4065-8d3c-7c29b67304b0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups "Geb
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/geb-user/CA%2B52dQROy1c2H05VPL1RwHwPWBPzqEGbv0tTZrCkYABVReTLag%40mail.gmail.com.