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

Is /sessions W3C compliant? #24

Open
mhanberg opened this issue Apr 22, 2020 · 5 comments
Open

Is /sessions W3C compliant? #24

mhanberg opened this issue Apr 22, 2020 · 5 comments

Comments

@mhanberg
Copy link
Member

I was playing around with the repo last night to see if it could run Geckodriver as a standalone server (no selenium), and I was seeing some failing tests when calling FetchSessions.

After some investigations, it looks like that endpoint is not in the webdriver spec. Geckodriver has never implemented the JWP, which would explain why it doesn't implement that endpoint but chromedriver does.

Does that seem correct?

Thanks!

PS: I was wanting to see if geckodriver standalone would be faster than selenium+geckodriver

@aaronrenner
Copy link
Member

I remember I noticed that too, but it appears I was able to run FetchSessions across all of the drivers WebDriverClient is currently supporting

https://github.com/aaronrenner/web_driver_client/blob/600722c17057ee3350081e635cf3f93c067bfedd/test/integration/session_mangement_test.exs#L24-L28

If you wanted to run the web_driver_client tests against geckodriver directly you could edit WebDriverClient.IntegrationTesting.Scenarios and add the following:

  1. Add a scenario to @scenarios
    %Scenario{
      driver: :geckodriver,
      browser: :firefox,
      session_configuration_name: :w3c_headless,
      protocol: :w3c
    }
  2. Add a new clause to get_start_session_payload/1
    def get_start_session_payload(%Scenario{
          driver: :geckodriver,
          session_configuration_name: :w3c_headless
        }) do
      %{
        capabilities: %{
          alwaysMatch: %{
            "moz:firefoxOptions" => %{
              "args" => [
                "-headless"
              ]
            }
          }
        }
      }
    end
  3. Add a new clause to get_default_base_url/1

Once these updates are done, you should be able to run the geckodriver tests with

$ mix test --only integration_test_driver:geckodriver

I'm curious what you find out. I think I remember geckodriver was a bit buggy, but that could have been because I was trying to send JWP requests to it. 😉

@mhanberg
Copy link
Member Author

Yes, I did all that, already. That is how I noticed that the calls to FetchSessions were failing.

I wonder if this means that FetchSessions shouldn't be a supported command for w3c servers, since it technically isn't supported.

@aaronrenner
Copy link
Member

I think it's still useful for drivers that support it. Especially when when wallaby starts up chromedriver (I believe that returns a w3c response). Out of curiosity, what is the error being returned?

@mhanberg
Copy link
Member Author

Returns a 405 Method Not Allowed.

Seems to return that for any endpoint that doesn't exists.

@mhanberg
Copy link
Member Author

I think geckodriver also only supports one sessions per instance of the server, which might explain why it doesn't implement an endpoint to fetch all sessions.

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

No branches or pull requests

2 participants