0
votes

My code is as follows:

public static void main(String[] args) {
    WebDriver driver;
    System.setProperty("webdriver.gecko.driver", "E:\\gecko\\geckodriver.exe");
    System.out.println("Gecko Driver Found");
    driver =new FirefoxDriver();
    System.out.println("WebDriver Established");
    driver.get("http://www.supremenewyork.com/shop/all/sweatshirts");
    System.out.println("Connection Established");
}
}

Running this gives me SessionNotCreatedException when the program tries to establish the driver, which I'll dump at the bottom. I'm just trying to make the program load a webpage right now, so any help would be great.

Console Output:

Sep 30, 2016 10:26:37 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end 1475288797965 addons.xpi WARN Error loading bootstrap.js for {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}: Module resource://gre/modules/commonjs/sdk/addon/bootstrap.js is not found at resource://gre/modules/commonjs/sdk/addon/bootstrap.js (resource://gre/modules/commonjs/toolkit/require.js:24) JS Stack trace: make/[email protected]:24:12 < @bootstrap.js:10:23 < @XPIProvider.jsm:4339:1 < [email protected]:4339:7 < [email protected]:4414:1 < [email protected]:3334:1 < [email protected]:3443:23 < [email protected]:3604:34 < [email protected]:2092:25 < [email protected]:208:12 < [email protected]:667:5 < [email protected]:824:9 < [email protected]:2402:5 < [email protected]:55:7 1475288797965 addons.xpi WARN Exception running bootstrap method install on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}: TypeError: this.bootstrapScopes[aAddon.id][aMethod] is not a function (resource://gre/modules/addons/XPIProvider.jsm:4442:8) JS Stack trace: [email protected]:4442:9 < [email protected]:3334:1 < [email protected]:3443:23 < [email protected]:3604:34 < [email protected]:2092:25 < [email protected]:208:12 < [email protected]:667:5 < [email protected]:824:9 < [email protected]:2402:5 < [email protected]:55:7 Sep 30, 2016 10:26:38 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Falling back to straight W3C remote end connection 1475288799084 addons.xpi WARN Error loading bootstrap.js for {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}: Module resource://gre/modules/commonjs/sdk/addon/bootstrap.js is not found at resource://gre/modules/commonjs/sdk/addon/bootstrap.js (resource://gre/modules/commonjs/toolkit/require.js:24) JS Stack trace: make/[email protected]:24:12 < @bootstrap.js:10:23 < @XPIProvider.jsm:4339:1 < [email protected]:4339:7 < [email protected]:4414:1 < [email protected]:3334:1 < [email protected]:3443:23 < [email protected]:3604:34 < [email protected]:2092:25 < [email protected]:208:12 < [email protected]:667:5 < [email protected]:824:9 < [email protected]:2402:5 < [email protected]:55:7 1475288799085 addons.xpi WARN Exception running bootstrap method install on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}: TypeError: this.bootstrapScopes[aAddon.id][aMethod] is not a function (resource://gre/modules/addons/XPIProvider.jsm:4442:8) JS Stack trace: [email protected]:4442:9 < [email protected]:3334:1 < [email protected]:3443:23 < [email protected]:3604:34 < [email protected]:2092:25 < [email protected]:208:12 < [email protected]:667:5 < [email protected]:824:9 < [email protected]:2402:5 < [email protected]:55:7 Sep 30, 2016 10:26:40 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Falling back to original OSS JSON Wire Protocol. 1475288800182 addons.xpi WARN Error loading bootstrap.js for {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}: Module resource://gre/modules/commonjs/sdk/addon/bootstrap.js is not found at resource://gre/modules/commonjs/sdk/addon/bootstrap.js (resource://gre/modules/commonjs/toolkit/require.js:24) JS Stack trace: make/[email protected]:24:12 < @bootstrap.js:10:23 < @XPIProvider.jsm:4339:1 < [email protected]:4339:7 < [email protected]:4414:1 < [email protected]:3334:1 < [email protected]:3443:23 < [email protected]:3604:34 < [email protected]:2092:25 < [email protected]:208:12 < [email protected]:667:5 < [email protected]:824:9 < [email protected]:2402:5 < [email protected]:55:7 1475288800183 addons.xpi WARN Exception running bootstrap method install on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}: TypeError: this.bootstrapScopes[aAddon.id][aMethod] is not a function (resource://gre/modules/addons/XPIProvider.jsm:4442:8) JS Stack trace: [email protected]:4442:9 < [email protected]:3334:1 < [email protected]:3443:23 < [email protected]:3604:34 < [email protected]:2092:25 < [email protected]:208:12 < [email protected]:667:5 < [email protected]:824:9 < [email protected]:2402:5 < [email protected]:55:7 Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{marionette=true, browserName=firefox, version=, platform=ANY}], required capabilities = Capabilities [{}] Build info: version: '3.0.0-beta4', revision: '3169782', time: '2016-09-29 10:29:23 -0700' System info: host: [REDACTED], ip: [REDACTED], os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_101' Driver info: driver.version: FirefoxDriver at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:80) 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:602) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:129) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:247) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:235) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:230) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:226) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:124) at copDatBogo.SupremeAccesser.main(SupremeAccesser.java:11)

1

1 Answers

0
votes

Thanks to an edit made by Daniel Cheng I was able to gopogle the exception and diagnose the issue.

I reinstalled firefox, but did so to a new directory. My final functioning code is as follows:

package copDatBogo;
import java.io.File;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxBinary;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
public class SupremeAccesser {



public static void main(String[] args) {
        WebDriver driver;
        System.setProperty("webdriver.gecko.driver", "E:\\gecko\\geckodriver.exe");
        File pathToBinary = new File("path to firefox.exe");
        FirefoxBinary ffBinary = new FirefoxBinary(pathToBinary);
        FirefoxProfile ffProfile = new FirefoxProfile();
        System.out.println("Gecko Driver Found");
        driver =new FirefoxDriver(ffBinary, ffProfile);
        System.out.println("WebDriver Established");
        driver.get("URL");
        System.out.println("Connection Established");
    }
}

I apologize for my lackluster diagnostic skill and will comb the error messages more thoroughly in the future.