mercredi 5 octobre 2016

Selenium:Error communicating with the remote browser. It may have died

Vote count: 0

Using Selenium and trying to just do a simple test but get following message:

org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died. Build info: version: 'unknown', revision: 'c7b525d', time: '2016-09-01 14:52:30 -0700' System info: host: 'LPT-ANJA01', ip: '10.63.20.166', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_101' Driver info: driver.version: RemoteWebDriver

I am extending a base class that just open a webpage. But then nothing happens.

Baseclass:

import java.util.concurrent.TimeUnit;

import org.junit.After;
import org.junit.Before;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;

public class BaseClass {
     WebDriver driver;

        @Before
        public void setUp() {

            System.setProperty("webdriver.gecko.driver","C:\\Selenium\\geckodriver.exe");

            ProfilesIni allProfiles = new ProfilesIni();
            FirefoxProfile myProfile = allProfiles.getProfile("default");
            myProfile.setAcceptUntrustedCertificates(true);
            myProfile.setAssumeUntrustedCertificateIssuer(true);
            driver = new FirefoxDriver(myProfile);

            driver.manage().window().maximize();

            driver.get("http://blahbal.com");



            }



        @After
        public void closeApplication(){

            driver.quit();

        }

}

And the test class:

import static org.junit.Assert.*;

import java.util.concurrent.TimeUnit;

import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

public class AssertTitleTest extends BaseClass {


    @Test
    public void test() {
        System.out.println(driver.getTitle());


    }

}

asked 16 secs ago

Let's block ads! (Why?)



Selenium:Error communicating with the remote browser. It may have died

Aucun commentaire:

Enregistrer un commentaire