fix20152
@fix20152
javascript developer

Selenium server на Ubuntu Server 12.04 — в чем проблема?

Добрый день.
Такая проблема, когда запускаю селениум сервер, все работает нормально, ну когда пытаюсь провести тест, выдает ошибку. Может, кто сталкивался с такой проблемой?
При запуске выдает все ок -
INFO: Launching a standalone server
11:41:55.393 INFO - Java: Oracle Corporation 24.55-b03
11:41:55.396 INFO - OS: Linux 2.6.32-042stab085.20 amd64
11:41:55.443 INFO - v2.36.0, with Core v2.36.0. Built from revision 9b50f80
11:41:55.785 INFO - Default driver org.openqa.selenium.iphone.IPhoneDriver registration is skipped: registration capabilities Capabilities [{platform=MAC, browserName=iPad, version=}] does not match with current platform: LINUX
11:41:55.820 INFO - Default driver org.openqa.selenium.iphone.IPhoneDriver registration is skipped: registration capabilities Capabilities [{platform=MAC, browserName=iPhone, version=}] does not match with current platform: LINUX
11:41:55.820 INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match with current platform: LINUX
11:41:56.024 INFO - RemoteWebDriver instances should connect to: http://127.0.0.2:4444/wd/hub
11:41:56.026 INFO - Version Jetty/5.1.x
11:41:56.028 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
11:41:56.032 INFO - Started HttpContext[/selenium-server,/selenium-server]
11:41:56.032 INFO - Started HttpContext[/,/]
11:41:57.817 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@641ab54a
11:41:57.817 INFO - Started HttpContext[/wd,/wd]
11:41:57.822 INFO - Started SocketListener on 0.0.0.0:4444
11:41:57.822 INFO - Started org.openqa.jetty.jetty.Server@264d107e


Когда провожу тест, выдает ошибку -
11:43:15.829 INFO - Executing: [new session: {browserName=firefox}] at URL: /session)
11:43:15.937 INFO - Creating a new session for Capabilities [{browserName=firefox}]
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: cannot open display: localhost:99.0
Error: cannot open display: localhost:99.0

        at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:108)
        at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:250)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:110)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:197)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:190)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:108)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:62)
        at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:56)
        at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:215)
        at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:169)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
11:44:03.461 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.36.0', revision: '9b50f80', time: '2013-10-17 16:23:30'
System info: host: 'canwalkonwater', ip: '93.188.166.167', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-042stab085.20', java.version: '1.7.0_55'
Driver info: driver.version: unknown
        at java.util.concurrent.FutureTask.report(Unknown Source)
        at java.util.concurrent.FutureTask.get(Unknown Source)
        at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:176)
        at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:112)
        at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:89)
        at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:104)
        at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:63)
        at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:205)
        at org.openqa.selenium.remote.server.JsonHttpRemoteConfig.handleRequest(JsonHttpRemoteConfig.java:192)
        at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:201)
        at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:167)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:139)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
        at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:677)
        at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
        at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
        at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
        at org.openqa.jetty.http.HttpServer.service(HttpServer.java:914)
        at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
        at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
        at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
        at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
        at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
        at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.36.0', revision: '9b50f80', time: '2013-10-17 16:23:30'
System info: host: 'canwalkonwater', ip: '93.188.166.167', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-042stab085.20', java.version: '1.7.0_55'
Driver info: driver.version: unknown
        at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:72)
        at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:56)
        at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:215)
        at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:169)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:62)
        ... 8 more
Caused by: org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/usr/bin/firefox) on port 7055; process output follows:
Error: cannot open display: localhost:99.0
Error: cannot open display: localhost:99.0

Build info: version: '2.36.0', revision: '9b50f80', time: '2013-10-17 16:23:30'
System info: host: 'canwalkonwater', ip: '93.188.166.167', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-042stab085.20', java.version: '1.7.0_55'
Driver info: driver.version: FirefoxDriver
        at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:120)
        at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:250)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:110)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:197)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:190)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:108)
        ... 13 more
Caused by: org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: cannot open display: localhost:99.0
Error: cannot open display: localhost:99.0

        at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:108)
        ... 18 more
11:44:03.492 WARN - Exception: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: cannot open display: localhost:99.0
Error: cannot open display: localhost:99.0
  • Вопрос задан
  • 3338 просмотров
Решения вопроса 1
pomeo
@pomeo
@fix20152 ну всё же просто, не знаю как вы его в прошлом вопросе запускали, но здесь он ясно пишет что ему X сервер нужен. Не в курсе как селениум настраивается с firefox на сервере, но firefox запускал. Вашу проблему решит xvfb
Ответ написан
Пригласить эксперта
Ответы на вопрос 1
@masterlir
Я хз у меня ни Селен ни Ватир не работают под Убунту, все вываливаются с таймаутом и все. Перловый может еще работает я не помню. Но руби нет.
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы