Getting SessionNotCreatedException

292 views
Skip to first unread message

remya...@gmail.com

unread,
Dec 16, 2016, 4:08:53 AM12/16/16
to Selenium Users
Hi,

this is my code...

package Online_Support_Framework;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;

public class First_Class {

public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.gecko.driver", "C:\\\\Users\\npr1\\Desktop\\Selenium\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("http://www.toolsqa.com");

Thread.sleep(5000);
driver.close();
}

}


I'm getting the below error

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{marionette=true, firefoxOptions=org.openqa.selenium.firefox.FirefoxOptions@5700d6b1, browserName=firefox, moz:firefoxOptions=org.openqa.selenium.firefox.FirefoxOptions@5700d6b1, version=, platform=ANY}], required capabilities = Capabilities [{}]
Build info: version: 'unknown', revision: '1969d75', time: '2016-10-18 09:43:45 -0700'
System info: host: 'INGSRANJAVL2C', ip: '10.30.118.146', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_111'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:91)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:259)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:247)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:242)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:238)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:127)
at Online_Support_Framework.First_Class.main(First_Class.java:13)


Could u guyz help me on this??

Anish Pillai

unread,
Dec 18, 2016, 6:41:25 PM12/18/16
to Selenium Users
Hi,

Can you try replacing "C:\\\\Users\\npr1\\Desktop\\Selenium\\geckodriver.exe" with "C:\\Users\\npr1\\Desktop\\Selenium\\geckodriver.exe" and see if it works (I have replaced C:\\\\ with C:\\)

If it doesn't work try the method of adding the geckodriver location to the enrivonment path variable using this article - http://www.automationtestinghub.com/selenium-3-0-launch-firefox-with-geckodriver/

Also please share Selenium/GeckoDriver/FF browser versions, if this doesn't work.


Thanks
Reply all
Reply to author
Forward
0 new messages