mardi 11 octobre 2016

Selenium test on VM with Geckodriver

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:

 @BeforeClass
   public void setUp() {
       System.setProperty("webdriver.gecko.driver","geckodriver.exe");
   }

   @Parameters("browser")
   @BeforeTest
   public void launchapp(String browser) throws MalformedURLException
   {


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

         System.out.println(" Executing on FireFox");
         String Node = "http://ift.tt/2dhHUHD";
         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

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

Aucun commentaire:

Enregistrer un commentaire