Interesting. Where would I find the version of Selenium I'm using? The only two Selenium dependencies I have in my build.gradle are testCompile 'org.seleniumhq.selenium:selenium-chrome-driver:3.141.59' testCompile 'org.seleniumhq.selenium:selenium-support:3.141.59'
So... I don't *think* I'm using 3.9.0, but even when printing out the full dependency tree I don't see anything that looks like a base Selenium library. On Saturday, October 26, 2019 at 4:23:22 PM UTC-5, Marcin Erdmann wrote: > > Ok, so this looks all good to me. I don't see how you'd be passing > anything other than what you see printed as credentials to SauceLabs. So > the only things that come to mind are you are using wrong credentials (are > you sure you're passing in an access key and not a password?) and SauceLabs > is lying that you're passing "None" or you've hit this issue I was able to > find: > https://support.saucelabs.com/hc/en-us/articles/360000921754-Authentication-Error-with-Selenium-3-9-0-Java-Client-Bindings > but > it's unlikely you're using Selenium 3.9.0 as it's been around for quite > some time. > > I've also double checked that nothing has recently changed on the > SauceLabs end and you can still pass creds as part of the URL > (as SauceLabsDriverFactory does) and it has not because Geb's own tests at > SauceLabs do not have any trouble with setting up the driver as of today: > https://circleci.com/gh/geb/geb/2202. > > On Fri, Oct 25, 2019 at 2:57 PM Ben Frey <[email protected] > <javascript:>> wrote: > >> Sure, here it is: >> import geb.driver.SauceLabsDriverFactory >> import org.openqa.selenium.Platform >> import org.openqa.selenium.chrome.ChromeDriver >> import org.openqa.selenium.remote.BrowserType >> >> geb.saucelabs.browser.browserName=BrowserType.IE >> geb.saucelabs.browser.platform=Platform.WINDOWS >> geb.saucelabs.browser.version=11 >> >> baseUrl = 'https://company.com' >> reportsDir = 'build/reports/tests/geb' >> >> waiting { >> timeout = 15 >> retryInterval = 0.5 >> } >> >> def sauceLabsBrowser = System.getProperty('geb.saucelabs.browser') >> if (sauceLabsBrowser) { >> driver = { >> def username = System.getenv("GEB_SAUCE_LABS_USER") >> assert username >> println 'In config, Sauce username is ' + username >> def accessKey = System.getenv("GEB_SAUCE_LABS_ACCESS_PASSWORD") >> assert accessKey >> >> new SauceLabsDriverFactory().create(sauceLabsBrowser, username, >> accessKey) >> } >> } else { >> System.setProperty('webdriver.chrome.driver', >> 'src/test/resources/chromedriver') >> driver = { new ChromeDriver() } >> } >> >> >> >> On Friday, October 25, 2019 at 2:47:15 AM UTC-5, Marcin Erdmann wrote: >>> >>> Can you please paste contents of your GebConfig.groovy? I trust what you >>> are saying but without seeing it, we won't be able to spot any mistakes >>> that you might have made. :) >>> >>> On Thu, Oct 24, 2019 at 8:21 PM Ben Frey <[email protected]> wrote: >>> >>>> It seems I'm still missing something; I'm getting an error message from >>>> Selenium code that my SauceLabs credentials are set to "None": >>>> geb.driver.DriverCreationException: failed to create driver from >>>> callback 'script15719444756301696857021$_run_closure2@3a13610b' >>>> at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory >>>> .groovy:35) >>>> 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 testpackage.TestClass.setupSpec(TestClass.groovy:8) >>>> >>>> Caused by: >>>> java.lang.reflect.InvocationTargetException >>>> at geb.driver.CloudDriverFactory.create(CloudDriverFactory. >>>> groovy:51) >>>> at script15719444756301696857021.run_closure2( >>>> script15719444756301696857021.groovy:30) >>>> at script15719444756301696857021.run_closure2( >>>> script15719444756301696857021.groovy) >>>> at geb.driver.CallbackDriverFactory.getDriver( >>>> CallbackDriverFactory.groovy:29) >>>> ... 19 more >>>> >>>> Caused by: >>>> org.openqa.selenium.WebDriverException: Unable to parse remote >>>> response: Misconfigured -- Sauce Labs Authentication Error. >>>> You used username 'None' and access key 'None' to authenticate, >>>> which are not valid Sauce Labs credentials. >>>> >>>> My sauceLabs config is set like this: >>>> sauceLabs { >>>> useTunnel = false >>>> browsers { >>>> create('internet explorer') { >>>> capabilities platform: 'Windows 7', browserVersion: '11' >>>> } >>>> } >>>> task { >>>> if (testSuite == 'specificTest') { >>>> filter { >>>> includeTestsMatching 'testpackage.*' >>>> } >>>> } >>>> } >>>> account { >>>> username = System.getenv(SauceAccount.USER_ENV_VAR) >>>> println 'In build.gradle, Sauce username is ' + username >>>> accessKey = System.getenv(SauceAccount.ACCESS_KEY_ENV_VAR) >>>> } >>>> connect { >>>> additionalOptions = ['--proxy', 'company.com:443/wd/hub'] >>>> } >>>> } >>>> >>>> In GebConfig.groovy I have exaclty the code from 14.1.1 in the BoG plus >>>> a println for the username. I see the username being printed out in both >>>> locations, so why is the Selenium code thinking the credentials aren't set? >>>> >>>> >>>> On Wednesday, October 23, 2019 at 3:56:49 PM UTC-5, Marcin Erdmann >>>> wrote: >>>>> >>>>> The issue you created Ben looks good, thanks! >>>>> >>>>> On Wed, Oct 23, 2019 at 6:27 PM Ben Frey <[email protected]> wrote: >>>>> >>>>>> Alright, I created https://github.com/geb/issues/issues/597. Please >>>>>> let me know if you'd like any more details in the issue. >>>>>> >>>>>> On Wednesday, October 23, 2019 at 8:09:53 AM UTC-5, Marcin Erdmann >>>>>> wrote: >>>>>>> >>>>>>> No, unfortunately that's not supported at the moment. We would need >>>>>>> to add support for adding multiple test tasks per capability/browser >>>>>>> type - >>>>>>> would you mind submitting an issue for that in the tracker? There's >>>>>>> already >>>>>>> a number of issues around improvements to cloud browser plugins, I >>>>>>> could >>>>>>> just make the next release all about that. >>>>>>> >>>>>>> With regards to a workaround for this, there's nothing that comes to >>>>>>> my mind apart from a nasty hack where you would set a project property >>>>>>> on >>>>>>> the command line, like -PstuffToTest=a and then have an if statement >>>>>>> like: >>>>>>> >>>>>>> sauceLabs { >>>>>>> task { >>>>>>> if (stuffToTest == "a") { >>>>>>> filter { >>>>>>> includeTestsMatching 'stufftotest.*' >>>>>>> } >>>>>>> } >>>>>>> } >>>>>>> } >>>>>>> } >>>>>>> >>>>>>> Nasty, but can work in the meantime. >>>>>>> >>>>>>> On Wed, Oct 23, 2019 at 1:59 PM Ben Frey <[email protected]> >>>>>>> wrote: >>>>>>> >>>>>>>> Oh, I guess I didn't quite get the implications of bullet point 4 >>>>>>>> there, thanks for clarifying. So is there a way to filter or group >>>>>>>> tests >>>>>>>> based on test class/method rather than capability? I'm trying to run >>>>>>>> groups >>>>>>>> of scenarios in parallel CI jobs, rather than all of the tests in one. >>>>>>>> >>>>>>>> On Wednesday, October 23, 2019 at 7:55:08 AM UTC-5, Marcin Erdmann >>>>>>>> wrote: >>>>>>>>> >>>>>>>>> Yeah, this is where the problem is. The Gradle SauceLabs plugin >>>>>>>>> adds a separate task to run tests at SauceLabs - any tasks that you >>>>>>>>> add >>>>>>>>> manually as well as the default test task will not include the >>>>>>>>> configuration for SauceLabs. Based on the configuration that you >>>>>>>>> provided >>>>>>>>> in the original email the test task name will be internetExplorerTest >>>>>>>>> - >>>>>>>>> it's derived on the name of the item that you add in the `browsers >>>>>>>>> {}` >>>>>>>>> configuration block. It's all described at >>>>>>>>> https://gebish.org/manual/current/#geb-saucelabs-plugin. >>>>>>>>> >>>>>>>>> On Wed, Oct 23, 2019 at 1:28 PM Ben Frey <[email protected]> >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> ./gradlew clean testTaskName >>>>>>>>>> >>>>>>>>>> where "testTaskName" is a Gradle task defined like this >>>>>>>>>> task testTaskName(type: Test) { >>>>>>>>>> filter { >>>>>>>>>> includeTestsMatching 'stufftotest.*' >>>>>>>>>> } >>>>>>>>>> } >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Wednesday, October 23, 2019 at 6:27:12 AM UTC-5, Marcin >>>>>>>>>> Erdmann wrote: >>>>>>>>>>> >>>>>>>>>>> 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/b70f3fe1-acd7-4317-8df6-c74f91d77270%40googlegroups.com >>>>>>>>>> >>>>>>>>>> <https://groups.google.com/d/msgid/geb-user/b70f3fe1-acd7-4317-8df6-c74f91d77270%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/21fa1c21-3185-4a12-ab6e-cebc799bf5c1%40googlegroups.com >>>>>>>> >>>>>>>> <https://groups.google.com/d/msgid/geb-user/21fa1c21-3185-4a12-ab6e-cebc799bf5c1%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/8ba12b87-571b-4e65-a317-35c2ee010c5a%40googlegroups.com >>>>>> >>>>>> <https://groups.google.com/d/msgid/geb-user/8ba12b87-571b-4e65-a317-35c2ee010c5a%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/10691e84-4368-4661-b9be-e374f0fbfd87%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/geb-user/10691e84-4368-4661-b9be-e374f0fbfd87%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] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/geb-user/041a1079-b908-4416-bac7-5ed9e306f090%40googlegroups.com >> >> <https://groups.google.com/d/msgid/geb-user/041a1079-b908-4416-bac7-5ed9e306f090%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/af013a0a-24c4-4bd5-a69c-955bce55617f%40googlegroups.com.
