Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting Geckodriver fails #25

Closed
APshenkin opened this issue Mar 14, 2017 · 16 comments
Closed

Starting Geckodriver fails #25

APshenkin opened this issue Mar 14, 2017 · 16 comments
Labels
Milestone

Comments

@APshenkin
Copy link

2017/03/14 20:48:37 Starting process: [/usr/local/lib/node_modules/selenium-standalone/.selenium/geckodriver/0.15.0-x64-geckodriver --log-level=DEBUG --port=59269]
2017/03/14 20:48:47 Terminating process 3046
2017/03/14 20:48:47 Process 3046 terminated
2017/03/14 20:48:47 [SERVICE_STARTUP_FAILED] [error: http://127.0.0.1:59269 does not respond in 10s]

browserconfig:

{
  "firefox": {
    "default": "latest",
    "versions": {
      "latest": {
        "image": ["/usr/local/geckodriver/0.12.0-x64-geckodriver", "--log-level=DEBUG"],
        "port": "4444"
      }
    }
  },
  "chrome": {
    "default": "latest",
    "versions": {
      "latest": {
        "image": ["/usr/local/chromedriver/2.28-x64-chromedriver", "--log-level=DEBUG"],
        "port": "4444"
      }
    }
  }
}

BTW Chrome works great

@vania-pooh
Copy link
Member

@APshenkin from the log file that's not clear why it's not working. Will experiment tomorrow.

@aandryashin
Copy link
Member

According geckodriver options, you have to use command like this:

"image": ["geckodriver", "--log", "debug"]

@APshenkin
Copy link
Author

@aandryashin thanks for help! Now I'm able to launch firefox. But there is other issue:
geckodriver is an implementation of the WebDriver specification and consequently does not implement the Selenium JSON wire protocol.
As far as I understand Selenium aims to provide a Selenium-to-WebDriver shim that lets Selenium clients speak to both W3C WebDriver and Selenium WebDriver remotes.
But Selenoid doesn't provide the same feature. Because of this I can't launch tests for Chrome and firefox. I should do in my test app Selenium-to-WebDriver shim for firefox (but this is already worked with selenium)

Here is several examples:

Get elements requests:
Selenium response body for Firefox and chrome:

{ state: 'success',
  sessionId: '388e6505-5144-4895-ae9c-69c91d4fdab1',
  hCode: 1151183417,
  value: [ { ELEMENT: '0' } ],
  class: 'org.openqa.selenium.remote.Response',
  status: 0 }

Selenoid response for Firefox (for chrome is the same as for selenium, because chromedriver uses Selenium protocol):
{"value":[{"element-6066-11e4-a52e-4f735466cecf":"a815dba6-e075-964c-8aa6-2983cb893e7a”}]}

Because of this issue it's hard to start using Selenoid. We have to do the same work that before did for us selenium(

@aandryashin
Copy link
Member

The main goal of Selenoid is to provide container isolation for browsers, and it is possible to use it with official Selenium images from Docker hub. To run Firefox please try selenium/standalone-firefox image. Ability to run driver binary as a process was implemented only for Internet Explorer.

@vania-pooh
Copy link
Member

@APshenkin our tests show that even with Java inside container starts 3-5 seconds. What you get instead is well-known browser and operating system state.

@APshenkin
Copy link
Author

@aandryashin @vania-pooh Thanks for information
In case with Firefox it would be great to use docker images without java to decrease proxies between tests and browser and also decrease images sizes

I have got to work my test framefork with latest selenoid firefox image. But it's contains 0.14 geckodriver. With 0.15 we will face the problem, because the session id on init is now places to value in response body, ex:

0.15 version
{"value": {"sessionId":"737d247e-b0e8-0f40-8149-12597a96fef3","value":{"XULappId":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","acceptSslCerts":false,"appBuildId":"20170125094131"......}}}
0.14 version
{"sessionId":"e0f3aa9f-431f-6d41-8bba-6783b17e2343","value":{"XULappId":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","acceptSslCerts":false,"appBuildId":"20170125094131"....}}

Looks like it's easy to fix, just check value.sessionId if sessionId is empty or undefined https://github.com/aandryashin/selenoid/blob/master/selenoid.go#L135

I'm newbie in Go lang, so if you can add this check in selenoid, it would be very nice

@APshenkin
Copy link
Author

Also when I try to use selenium/standalone-firefox, git this error:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="/assets/displayhelpservlet.css" media="all"/>
  <link href="/assets/favicon.ico" rel="icon" type="image/x-icon" />
  <script src="/assets/jquery-3.1.1.min.js" type="text/javascript"></script>
  <script src="/assets/displayhelpservlet.js" type="text/javascript"></script>
  <script type="text/javascript">
    var json = Object.freeze('{"version":"3.1.0","type":"Standalone","consoleLink":"/wd/hub"}')

@vania-pooh
Copy link
Member

@APshenkin btw, the issue with changed Geckodriver protocol was fixed in aandryashin@34db1a4.

@APshenkin
Copy link
Author

APshenkin commented Mar 17, 2017

Hmm, not sure about this.

here are logs:

2017/03/17 15:44:58 Starting process: [/usr/local/lib/node_modules/selenium-standalone/.selenium/geckodriver/0.15.0-x64-geckodriver --port=63977]
2017/03/17 15:44:58 Process 25507 started in: 103.662613ms
2017/03/17 15:44:58 Proxying requests to: http://127.0.0.1:63977
2017/03/17 15:44:58 [SESSION_ATTEMPTED] [http://127.0.0.1:63977]
2017/03/17 15:45:00 [SESSION_FAILED] Bad response from [http://127.0.0.1:63977] - [200 OK]

Yes, I understand that main goal of Selenoid is to provide container isolation for browsers, but looks like there is no matter is this case using docker image or binary

@APshenkin
Copy link
Author

APshenkin commented Mar 17, 2017

Sorry, my fault :( I didn't update Selenoid. Now it's working. Will send PR to update geckodriver in docker image https://github.com/selenoidhq/docker-selenoid/pull/2

@vania-pooh
Copy link
Member

@APshenkin ok. Btw, Selenoid containers will move soon to another organization.

@vania-pooh
Copy link
Member

@APshenkin btw, just built aandryashin/selenoid:latest container from the latest source.

@vania-pooh vania-pooh modified the milestone: 1.1.0 Mar 20, 2017
@vania-pooh vania-pooh added the bug label Mar 21, 2017
@vania-pooh
Copy link
Member

vania-pooh commented Mar 23, 2017

@aandryashin: according to Geckodriver release notes starting from version 0.15.0 they're following W3C Webdriver spec. Selenium 3.3.1 already fixed this. Need to do the same stuff in Selenoid.

@aandryashin
Copy link
Member

I have fixed it in 34db1a4 but it's related only for Selenoid not for ggr.

@vania-pooh
Copy link
Member

@APshenkin did the fix above help? You can try it with aandryashin/selenoid:latest.

@APshenkin
Copy link
Author

@vania-pooh Yes, everything works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants