Java, Selenium, Selenium grid, Testing, TestNG, Web Automation

FAILED CONFIGURATION: @BeforeMethod setUp org.openqa.selenium. WebDriverException: Error forwarding the new session Empty pool of VM for setup Capabilities


[TestNG] Running:
C:\Users\user\AppData\Local\Temp\testng-eclipse-2068414740\testng-customsuite.xml

FAILED CONFIGURATION: @BeforeMethod setUp
org.openqa.selenium.WebDriverException: Error forwarding the new session Empty pool of VM for setup Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}]
Command duration or timeout: 200 milliseconds
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'ksehgal', ip: '192.168.0.162', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_67'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)


SKIPPED CONFIGURATION: @AfterMethod tearDown
SKIPPED: windowsTest

===============================================
Default test
Tests run: 1, Failures: 0, Skips: 1
Configuration Failures: 1, Skips: 1
===============================================
===============================================
Default suite
Total tests run: 1, Failures: 0, Skips: 1
Configuration Failures: 1, Skips: 1
===============================================

[TestNG] Time taken by org.testng.reporters.XMLReporter@6beb8639: 16 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 6 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@1a0c3b27: 44 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@21d195ca: 4 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@390f8c82: 23 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@6ba52c90: 7 ms

How I encountered this error

  • Step1 Start selenium grid hub
 java -jar selenium-server-standalone-2.41.0.jar -role hub

  • Step2 Start executing test scripts.
  • Step3 You will get the above error.

Solution

  • You does not have any node in the selenium grid whole set up.
  • Start command prompt from your local or some machine and execute this command
 java -jar selenium-server-standalone-2.41.0.jar -role node -hub http://<hub-ip>:<hub-port>/grid/register

  • Now run your tests again.
  • They should run fine.

Conclusion

  1. To run your test scripts on a selenium grid network, you require minimum 1 hub and 1 node. So as to run your test scripts.
  2. Hub is responsible to take care of navigating your test scripts to the desired environment combination. And node will actually run your test scripts.
Advertisements

5 thoughts on “FAILED CONFIGURATION: @BeforeMethod setUp org.openqa.selenium. WebDriverException: Error forwarding the new session Empty pool of VM for setup Capabilities”

  1. I am very new to automation testing :

    package com.test;

    import org.testng.annotations.BeforeMethod;
    import org.testng.annotations.Test;

    import java.io.File;

    import io.appium.java_client.android.AndroidDriver;

    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.util.concurrent.TimeUnit;

    //import org.apache.commons.exec.CommandLine;
    //import org.apache.commons.exec.DefaultExecuteResultHandler;
    //import org.apache.commons.exec.DefaultExecutor;
    //import org.apache.commons.exec.ExecuteException;
    //import org.openqa.selenium.By;
    import org.openqa.selenium.remote.DesiredCapabilities;
    //import org.openqa.selenium.remote.RemoteWebDriver;
    //import org.testng.annotations.AfterMethod;
    import org.testng.annotations.BeforeMethod;
    //import org.testng.annotations.Test;
    //import org.openqa.selenium.WebDriver;

    public class AppiumTest {

    private AndroidDriver driver;

    //public class SetupAndroidAppium{

    //static DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
    // static DefaultExecutor executor = new DefaultExecutor();
    @BeforeMethod
    public void setUp() throws MalformedURLException {
    File classpathRoot = new File(System.getProperty(“user,dir “));

    File appDir = new File(classpathRoot, “Application”);

    File app = new File(appDir,”WestJet-qa-debug-unaligned__28_.apk”);

    DesiredCapabilities capabilities = new DesiredCapabilities();

    capabilities.setCapability(“platformName”,”Android”);

    capabilities.setCapability(“app”,app.getAbsoluteFile());

    capabilities.setCapability(“app-package”,”com.*****”);
    capabilities.setCapability(“platformVersion”,”5.1″);
    capabilities.setCapability(“deviceName”,”Nexus_5″);
    driver = new AndroidDriver(new URL(“0.0.0.0:4723”),capabilities);
    driver.close();
    }
    @Test
    public void launchEmulator() throws Exception{
    }
    //}
    }

    When I try to run this I get above Error message but I could not follow you in above example ?

    Please can you help me understand this ?

    Like

    1. HI Jig,
      As far as I understood you are trying to create an android test file in java, but I am doing it for selenium only, not for Appium. May be an updation of latest version in your jars might help.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s