Thanks for your insight. You are right, it is not problem with Geb. Somehow
the firefox process was already killed and doesn't now exist anymore. See
the below error when I used the latest geckodriver ver 23.
geb.driver.DriverCreationException: failed to create driver from callback
'script15493888271531518901856$_run_closure1$_closure4$_closure7@6aa936ee'
at
geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
at
geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:85)
at
geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy)
at
geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:32)
at
geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:84)
at geb.Configuration.createDriver(Configuration.groovy:382)
at geb.Configuration.getDriver(Configuration.groovy:371)
at geb.Browser.getDriver(Browser.groovy:111)
at geb.Browser.retrieveCurrentUri(Browser.groovy:511)
at geb.Browser.go(Browser.groovy:498)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:56)
at common.LoginHelper.login(LoginHelper.groovy:17)
at tests.CreateICSAccountTest. CSR user can login into the
PINApp(CreateICSAccountTest.groovy:49)*Caused by:
org.openqa.selenium.WebDriverException: invalid argument: can't kill an exited
proces*s
Build info: version: '3.141.59', revision: 'e82be7d358', time:
'2018-11-14T08:17:03'
System info: host: 'va1c143', ip: '10.20.10.77', os.name: 'Linux', os.arch:
'amd64', os.version: '2.6.32-754.9.1.el6.x86_64', java.version: '1.8.0_191'
Driver info: driver.version: FirefoxDriver
remote stacktrace:
at
org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62)
at
org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
at
org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
at
java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at
java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at
java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at
java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at
java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at
org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
at
org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
at
org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
at
org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at
org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:147)
at
org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
at
script15493888271531518901856$_run_closure1.closure4$_closure7(script15493888271531518901856.groovy:17)
at
script15493888271531518901856$_run_closure1.closure4$_closure7(script15493888271531518901856.groovy)
at
geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29)
... 12 more
On Monday, February 4, 2019 at 9:33:46 PM UTC-5, Alexander Kriegisch wrote:
>
> Ramesh,
>
> I am a bit irritated. Your subject line says PhantomJS, the message body
> says GeckoDriver (i.e. Firefox). So which one causes the problem?
>
> Please also note that for PhantomJS you do not need a framebuffer (xvfb),
> which is the main reason for me using it with Jenkins and my recommendation
> for you, too. I have no experience with drivers needing normal browsers on
> headless CI servers and using xvfb, so I also do not know how well that
> works. When I need to run normal browsers in a "headless" mode, usually I
> use cloud testing services, e.g. Testbirds, Browserstack etc.
>
> Having read your SO post, I see that the problem seems to be caused by
> GeckoDriver and in the stacktrace there also is a C/C++ stacktrace, which
> IMO should not happen. So maybe there really is an intermittent problem
> with the driver or with same plus xvfb, I have no idea. I strongly doubt
> that Geb is connected to the problem in any way, so maybe here is not the
> right place to ask.
> Kind regards
> --
> Alexander Kriegisch
> https://scrum-master.de
>
> Ramesh schrieb am 04.02.2019 21:53:
>
> hi Marcin,
> Most of the time, the test runs fine but randomly sometimes I get this
> DriverCreationException
> because of connection refused.
> Please see stacktrace below. All my dependencies have no problem.
>
> Different combinations that I tried were:
>
> 1) Selenium 3.12.0 geb-spock:2.1 GeckoDriver 0.18.0
>
> 2) Selenium 3.12.0 geb-spock:2.1 GeckoDriver 0.23.0
>
> 3) Selenium 3.14.0 geb-spock:2.1 GeckoDriver 0.23.0
>
> I even tried setting xvfb display to an offset of 5. Also, checked any
> defunt geckodriver and firefox. There were no such defunct processes.
>
> Is there a way to try and catch this
> "org.openqa.selenium.WebDriverException: connection refused" and then try
> to create driver again? I asked the same question in stack overflow forum
> here:
> https://stackoverflow.com/questions/54463201/org-openqa-selenium-webdriverexception-connection-refused-with-selenium-geb-gec
>
>
> geb.driver.DriverCreationException: failed to create driver from callback
> 'script1548780037482534636672$_run_closure1$_closure4$_closure7@288e23a'
> at
> geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
> at
> geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:85)
> at
> geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy)
> at
> geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:32)
> at
> geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:84)
> at geb.Configuration.createDriver(Configuration.groovy:382)
> at geb.Configuration.getDriver(Configuration.groovy:371)
> at geb.Browser.getDriver(Browser.groovy:111)
> at
> geb.navigator.factory.BrowserBackedNavigatorFactory.<init>(BrowserBackedNavigatorFactory.groovy:35)
> at geb.Configuration.createNavigatorFactory(Configuration.groovy:417)
> at geb.Browser.createNavigatorFactory(Browser.groovy:133)
> at geb.Browser.getNavigatorFactory(Browser.groovy:121)
> at geb.Page.init(Page.groovy:144)
> at geb.Browser.createPage(Browser.groovy:859)
> at geb.Browser.to(Browser.groovy:550)
> at geb.Browser.to(Browser.groovy:539)
> at geb.spock.GebSpec.methodMissing(GebSpec.groovy:56)
> at tests.UserTest.Step 1: user can login(UserTest.groovy:40)
> Caused by: org.openqa.selenium.WebDriverException: connection refused
>
>
>
> Thanks,
> Ramesh
>
> On Monday, May 22, 2017 at 6:16:25 AM UTC-4, Marcin Erdmann wrote:
>>
>> The exception is thrown from within phantom js driver (at
>> org.openqa.selenium.phantomjs.PhantomJSDriverService.findPhantomJS) and
>> suggests to me that you are using a selenium version which is incompatible
>> with that version of the driver. Removing the `transitive = false` from
>> your dependency declaration should pull in the right version.
>>
>> On Mon, May 22, 2017 at 10:35 AM, <[email protected] <http://%20target=>>
>> wrote:
>>>
>>> I am on win8.1 using phantomjs-2.1.1-windows.
>>>
>>>
>>> On Monday, May 22, 2017 at 11:32:38 AM UTC+2, [email protected] wrote:
>>>>
>>>> I tried with
>>>>
>>>>
>>>> gebVersion = '1.1.1'
>>>>
>>>>
>>>>
>>>> testCompile("com.codeborne:phantomjsdriver:1.4.2") {
>>>> // phantomjs driver pulls in a different selenium version
>>>> transitive = false}
>>>>
>>>>
>>>> and got following
>>>>
>>>> geb.driver.DriverCreationException: failed to create driver from
>>>> callback
>>>> 'script1495445430407551713159$_run_closure2$_closure24$_closure46@6b4fae3c'
>>>>
>>>> Caused by:
>>>> java.lang.IllegalAccessError: tried to access class
>>>> org.openqa.selenium.os.ExecutableFinder from class
>>>> org.openqa.selenium.phantomjs.PhantomJSDriverService
>>>>
>>>> geb.driver.DriverCreationException: failed to create driver from
>>>> callback
>>>> 'script1495445430407551713159$_run_closure2$_closure24$_closure46@6b4fae3c'
>>>>
>>>> Caused by:
>>>> java.lang.IllegalAccessError:
>>>> org/openqa/selenium/os/ExecutableFinder
>>>>
>>>> com.bechtle.test.functional.specifications.next.hardware.shared.login.Login_TestSpec
>>>>
>>>> > Test: Go to CustomerAccountLoginPage FAILED
>>>> geb.driver.DriverCreationException: failed to create driver from
>>>> callback
>>>> 'script1495445430407551713159$_run_closure2$_closure24$_closure46@6b4fae3c'
>>>> at
>>>> geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
>>>> at
>>>> geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:85)
>>>> at
>>>> geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy)
>>>> at
>>>> geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:32)
>>>> at
>>>> geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:84)
>>>> at geb.Configuration.createDriver(Configuration.groovy:382)
>>>> at geb.Configuration.getDriver(Configuration.groovy:371)
>>>> at geb.Browser.getDriver(Browser.groovy:111)
>>>> at
>>>> geb.report.PageSourceReporter.getPageSource(PageSourceReporter.groovy:42)
>>>> at
>>>> geb.report.PageSourceReporter.writePageSource(PageSourceReporter.groovy:38)
>>>> at
>>>> geb.report.PageSourceReporter.writeReport(PageSourceReporter.groovy:29)
>>>> at
>>>> geb.report.CompositeReporter.writeReport(CompositeReporter.groovy:31)
>>>> at geb.Browser.report(Browser.groovy:927)
>>>> at geb.spock.GebReportingSpec.report(GebReportingSpec.groovy:59)
>>>> at
>>>> com.bechtle.test.functional.specifications.next.hardware.shared.login.Login_TestSpec.Test:
>>>>
>>>> Go to CustomerAccountLoginPage(Login_TestSpec.groovy:20)
>>>>
>>>> Caused by:
>>>> java.lang.IllegalAccessError:
>>>> org/openqa/selenium/os/ExecutableFinder
>>>> at
>>>> org.openqa.selenium.phantomjs.PhantomJSDriverService.findPhantomJS(PhantomJSDriverService.java:232)
>>>> at
>>>> org.openqa.selenium.phantomjs.PhantomJSDriverService.createDefaultService(PhantomJSDriverService.java:181)
>>>> at
>>>> script1495445430407551713159$_run_closure2.closure24$_closure46(script1495445430407551713159.groovy:497)
>>>> at
>>>> script1495445430407551713159$_run_closure2.closure24$_closure46(script1495445430407551713159.groovy)
>>>> at
>>>> geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29)
>>>> ... 14 more
>>>>
>>>>
>>>>
>>>> On Monday, May 22, 2017 at 11:08:22 AM UTC+2, Marcin Erdmann wrote:
>>>>>
>>>>> I don't see why it would not work with 1.4.x. What's the error you're
>>>>> getting?
>>>>>
>>>>> On Mon, May 22, 2017 at 8:52 AM, <[email protected]> wrote:
>>>>>>
>>>>>> hi,
>>>>>> should geb 1.x work with com.codeborne:phantomjsdriver:1.4.x? I can
>>>>>> only get it work with com.codeborne:phantomjsdriver:1.3.0.
>>>>>> any idea, hint or experience?
>>>>>> thank you
>>>>>> --
>>>>>> 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 post to this group, send email to [email protected].
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/geb-user/f0f771f3-9101-4d62-942d-e1f907d0aa63%40googlegroups.com
>>>>>>
>>>>>> <https://groups.google.com/d/msgid/geb-user/f0f771f3-9101-4d62-942d-e1f907d0aa63%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>> --
>>> 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] <http://%20target=>.
>>> To post to this group, send email to [email protected]
>>> <http://%20target=>.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/geb-user/d98c6fde-7a12-4db6-9c34-5457acd4c8d3%40googlegroups.com
>>>
>>> <https://groups.google.com/d/msgid/geb-user/d98c6fde-7a12-4db6-9c34-5457acd4c8d3%40googlegroups.com?utm_medium=email&utm_source=footer>.
>>>
>>>
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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 post to this group, send email to [email protected]
> <javascript:>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/geb-user/4eb068c9-4aa9-4275-8b36-ff3cd0da7761%40googlegroups.com
>
> <https://groups.google.com/d/msgid/geb-user/4eb068c9-4aa9-4275-8b36-ff3cd0da7761%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/geb-user/5e1b130a-8972-40ba-a340-ce377d77cb95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.