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

Getting unable to extract capabilities exception #1

Open
vinaybalepur opened this issue Oct 25, 2018 · 3 comments
Open

Getting unable to extract capabilities exception #1

vinaybalepur opened this issue Oct 25, 2018 · 3 comments

Comments

@vinaybalepur
Copy link

Hi. Thanks for sharing the way to create our own capabilities. But I am getting following exception even after following all the steps you have specified. Please let me know how to fix this.

org.openqa.grid.common.exception.GridException: Cannot extract a capabilities from the request:
The extra capability I have provided is nodeName. If I do not pass this then the node call goes through. With this it is failing.

Few more details -
Selenium server - 3.14
Appium java client - 6.1.0

@krmahadevan
Copy link
Member

@vinaybalepur - This doesn't seem to be a problem with Selenium, but looks to be a problem specific to the appium java client.

Here's a pure Selenium sample that still runs fine when using Selenium 3.14

import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class Example {
  private RemoteWebDriver driver;

  @BeforeClass
  public void beforeClass() throws MalformedURLException {
    URL url = new URL("http://localhost:4444/wd/hub");
    DesiredCapabilities dc = DesiredCapabilities.chrome();
    dc.setCapability("nodeName", "dummy");
    driver = new RemoteWebDriver(url, dc);
  }

  @Test
  public void testMethod() {
    driver.get("http://www.google.com");
    System.err.println("Title " + driver.getTitle());
  }

  @AfterClass
  public void afterClass() {
    if (driver != null) {
      driver.quit();
    }
  }
}

Here are the logs from the selenium grid node.

18:07 $ java -jar selenium-server-standalone-3.14.0.jar -role node
18:07:41.585 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.14.0', revision: 'aacccce0'
18:07:41.612 INFO [GridLauncherV3$3.launch] - Launching a Selenium Grid node on port 9741
2018-10-25 18:07:41.745:INFO::main: Logging initialized @548ms to org.seleniumhq.jetty9.util.log.StdErrLog
18:07:41.931 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 9741
18:07:41.932 INFO [GridLauncherV3$3.launch] - Selenium Grid node is up and ready to register to the hub
18:07:41.991 INFO [SelfRegisteringRemote$1.run] - Starting auto registration thread. Will try to register every 5000 ms.
18:07:41.991 INFO [SelfRegisteringRemote.registerToHub] - Registering the node to the hub: http://localhost:4444/grid/register
18:07:42.562 INFO [SelfRegisteringRemote.registerToHub] - The node is registered to the hub and ready to use
18:10:38.001 INFO [ActiveSessionFactory.apply] - Capabilities are: {
  "browserName": "chrome",
  "version": ""
}
18:10:38.003 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
Starting ChromeDriver 2.37.544337 (8c0344a12e552148c185f7d5117db1f28d6c9e85) on port 15476
Only local connections are allowed.
18:10:39.974 INFO [ProtocolHandshake.createSession] - Detected dialect: OSS
18:10:40.343 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session ad461ba6881a3fc8c238692fe718082a (org.openqa.selenium.chrome.ChromeDriverService)
18:10:42.601 INFO [ActiveSessions$1.onStop] - Removing session ad461ba6881a3fc8c238692fe718082a (org.openqa.selenium.chrome.ChromeDriverService)
18:16:21.430 INFO [ActiveSessionFactory.apply] - Capabilities are: {
  "browserName": "chrome",
  "nodeName": "dummy",
  "version": ""
}
18:16:21.431 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
Starting ChromeDriver 2.37.544337 (8c0344a12e552148c185f7d5117db1f28d6c9e85) on port 17911
Only local connections are allowed.
18:16:22.687 INFO [ProtocolHandshake.createSession] - Detected dialect: OSS
18:16:22.744 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session 959230718a278ce2a4772ee38595f979 (org.openqa.selenium.chrome.ChromeDriverService)
18:16:24.916 INFO [ActiveSessions$1.onStop] - Removing session 959230718a278ce2a4772ee38595f979 (org.openqa.selenium.chrome.ChromeDriverService)

I haven't tried anything using appium client... Do you have a simple standalone sample that can be used to reproduce this issue ? Please share a simple one, so that I can easily run it. I haven't setup appium on my machine for a very long time.

@vinaybalepur
Copy link
Author

vinaybalepur commented Oct 26, 2018

Thank you for the information. I can provide the code. But appium has to be set up for running it. Othere wise will not be possible.

@krmahadevan
Copy link
Member

@vinaybalepur - I am not asking for an appium setup. I am asking for a simple standalone test that can be executed to reproduce the issue. Also please ensure that the sample relies on using the demo app from appium.

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