1

Trying to run selenoid in my aws ec2 server

java code:-

 @Test
      public void chrome() throws MalformedURLException{
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setBrowserName("chrome");
        capabilities.setVersion("80.0");
        capabilities.setCapability("enableVNC", true);
        capabilities.setCapability("enableVideo", false);
        RemoteWebDriver   driver = new RemoteWebDriver(new 
       URL("http://x2.66.24x.xxx:4444/wd/hub"),capabilities);

         driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
          driver.get("https://www.google.com");

          WebElement hello = driver.findElement(By.name("q"));
            hello.sendKeys("hello");

            hello.sendKeys(Keys.ENTER);

            try {
                Thread.sleep(100000);
            } catch (InterruptedException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }


            driver.close();
    }

while running above code I can see new a session is created for chrome browser all operation will get perform but at the end, it will through exception & Same error i'm getting for firefox as well :

Apr 01, 2020 10:59:15 PM org.openqa.selenium.remote.DesiredCapabilities chrome INFO: Using new ChromeOptions() is preferred to DesiredCapabilities.chrome() Apr 01, 2020 10:59:18 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C Apr 01, 2020 11:01:01 PM org.openqa.selenium.remote.ErrorCodes toStatus INFO: HTTP Status: '404' -> incorrect JSON status mapping for 'unknown error' (500 expected) FAILED: chrome org.openqa.selenium.WebDriverException: An unknown error has occurred Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'LAPTOP-B5FT9H4U', ip: 'xx.1xx.x9.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181' Driver info: org.openqa.selenium.remote.RemoteWebDriver Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 80.0.3987.132, chrome: {chromedriverVersion: 80.0.3987.106 (f68069574609..., userDataDir: /tmp/.com.google.Chrome.7xE3Rs}, goog:chromeOptions: {debuggerAddress: localhost:40995}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify} Session ID: 2936e2a690849c764a8e00dd5f7001da

Ankur Singh
  • 1,239
  • 1
  • 8
  • 18
  • Show us your `browsers.json` file contents example. – vania-pooh Apr 02 '20 at 08:27
  • As per document, I didn't create any JSON file I'm just working with basic features. correct me we create json file only when we need to add some addition config to the selenoid. – Ankur Singh Apr 02 '20 at 08:45

1 Answers1

0

I had a similar issue and managed to solve it (at least for now) by increasing the session timeout:

capabilities.setCapability("sessionTimeout", "5m");
Ilja
  • 1