hound icon indicating copy to clipboard operation
hound copied to clipboard

(RuntimeError) Webdriver call status code 404 for post request

Open wlminimal opened this issue 8 years ago • 4 comments

Hello. I am testing in Phoenix. using phantomjs --wd and I ran tests, it shows this

test show fruits (MangoWeb.Acceptance.CategoryPageTest) test/mango_web/acceptance/category_page_test.exs:14 ** (RuntimeError) Webdriver call status code 404 for post request http://localhost:8910/session/47714dd0-8164-11e7-88af-fb13d02d786a/element. Check if webdriver server is running. Make sure it supports the feature being requested.

 code: page_title = find_element(:css, "page-title") |> visible_text()
 stacktrace:
   (hound) lib/hound/request_utils.ex:50: Hound.RequestUtils.handle_response/3
   (hound) lib/hound/helpers/page.ex:65: Hound.Helpers.Page.search_element/3
   (hound) lib/hound/helpers/page.ex:48: Hound.Helpers.Page.find_element/3
   test/mango_web/acceptance/category_page_test.exs:21: (test)

in phantomjs logs

[INFO - 2017-08-15T02:48:55.344Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 47714dd0-8164-11e7-88af-fb13d02d786a [ERROR - 2017-08-15T02:48:55.444Z] RouterReqHand - _handle.error - {"line":40,"stack":"get\n_find\n_locateElement\n_handleLocateCommand\n_handle\n_reroute\n_handle"}

wlminimal avatar Aug 15 '17 02:08 wlminimal

Hi, thanks for reporting.

I could not reproduce, what version of Phantomjs are you using? Could you please give a minimal example to reproduce?

Here is the example I tried:

use Hound.Helpers  
Hound.start_session()
navigate_to "https://tuvistavie.com/"
find_element(:class, "panel-cover__title") |> visible_text()

danhper avatar Sep 06 '17 04:09 danhper

The code snippet was from the book: Mastering Phoenix I was also stuck at the same page and googling led me here, :smile:

Anyway, the problem occurs when the phantomjs is installed through apt-get. Installing the latest phantomjs from the official page fixed the issue.

This issue can be closed.

kkweon avatar Oct 21 '17 07:10 kkweon

I was having same issue. After I've removed a package installed from official repository and downloaded it from official download page, issue got fixed. Both versions are same, 2.1.1. OS is Ubuntu 16.04.4 LTS, 64 bit.

denispeplin avatar Apr 09 '18 13:04 denispeplin

I have same problem:

phantomjs     | [INFO  - 2019-09-08T13:34:48.811Z] Session [6dc64860-d23d-11e9-8f59-95606648a3f2] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"2.1.1","driverName":"ghostdriver","driverVersion":"1.2.0","platform":"linux-unknown-64bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"},"phantomjs.page.settings.userAgent":"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1"}
phantomjs     | [INFO  - 2019-09-08T13:34:48.811Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 6dc64860-d23d-11e9-8f59-95606648a3f2
phantomjs     | [ERROR - 2019-09-08T13:34:49.326Z] RouterReqHand - _handle.error - {"line":264,"sourceURL":"phantomjs://code/webelement_request_handler.js","stack":"_postValueCommand@phantomjs://code/webelement_request_handler.js:264:52\n_handle@phantomjs://code/webelement_request_handler.js:72:30\n_reroute@phantomjs://code/request_handler.js:61:20\n_handle@phantomjs://code/session_request_handler.js:120:42\n_reroute@phantomjs://code/request_handler.js:61:20\n_handle@phantomjs://code/router_request_handler.js:78:46"}
phantomjs     |
phantomjs     |   phantomjs://platform/console++.js:263 in error

my docker-compose.yml:

version: '3'
services:
  dockerhost:
    image: qoomon/docker-host
    cap_add: [ 'NET_ADMIN', 'NET_RAW' ]
    restart: on-failure
  phantomjs:
    depends_on: [ dockerhost ]
    image: wernight/phantomjs:latest
    container_name: phantomjs
    restart: always
    ports:
      - "8910:8910"
    command: "phantomjs --webdriver=8910 --ignore-ssl-errors=true --ssl-protocol=any"

test:

defmodule Lighning.FeaturesTest do
  use ExUnit.Case
  use Hound.Helpers

  hound_session()

  test "something" do
  navigate_to("http://dockerhost:4002")
  end
end

lessless avatar Sep 08 '19 13:09 lessless