0

Hi I have been trying to run a test on a virtual machine. I have gone through the Internet and none of the solutions worked for me.

I want to open firefox on Windows virtual machine. Here is my code:

   @BeforeTest
   public void launchapp() throws MalformedURLException
   {
       System.setProperty("webdriver.gecko.driver","C:\\geckodriver.exe");

       String URL = "http://www.google.com";

         System.out.println(" Executing on FireFox");
         String Node = "http://XX.XX.X.XX:5555/wd/hub";
         URL url = new URL(Node);
         DesiredCapabilities desiredCapabilities = DesiredCapabilities.firefox();
         desiredCapabilities.setCapability("marionette", true);
         desiredCapabilities.setBrowserName("firefox");
         //driver = new FirefoxDriver(cap);

         driver = new RemoteWebDriver(url, desiredCapabilities);
         driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);


         driver.navigate().to(URL);
         driver.manage().window().maximize();

   }

The error I get on the virstual machine is:

The path to the driver executable must be set by the webdriver gecko.driver system property....

On my PC I only see on the console that its trying to connect the node but it fails:

Marking the node http://.... as down: cannot reach the node for 2 tries

and

Unregistering the node http://... because it's been down for XXX ms

and in Eclipse:

org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{marionette=true, browserName=firefox, version=, platform=ANY}], required capabilities = null

Do you have any idea why this is not working? What should I check?

k.horde
  • 149
  • 3
  • 12
  • Is executable `geckodriver.exe` on the same root folder?? – Saurabh Gaur Oct 11 '16 at 13:26
  • No, but I think the direction of this file is fine. I even moved it to `C:\geckodriver.exe` and changed the path to check - it is still not working. – k.horde Oct 11 '16 at 13:57
  • Is still giving exception as `The path to the driver executable must be set by the webdriver gecko.driver system property....`?? – Saurabh Gaur Oct 11 '16 at 14:49
  • Hi, unfortunately yes. In Eclipse I also see this error: `org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{marionette=true, browserName=firefox, version=, platform=ANY}], required capabilities = null` – k.horde Oct 12 '16 at 12:00

0 Answers0