org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 21:09:54'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_29'
Driver info: driver.version: RemoteWebDriver
这是我尝试运行脚本时显示的错误消息?场景:我的一个java文件有登录功能,第二个有登录后创建一个新帐户请指教。
登录.java:
public class LoginPage
{
public static WebDriver driver;
public static final LoginPage login = new LoginPage(new FirefoxDriver());
public LoginPage(WebDriver driver)
{
LoginPage.driver = driver;
}
public static void loginAs(String username, String password)
{
DesiredCapabilities ieCapabilities = DesiredCapabilities.firefox();
ieCapabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
Proxy proxy = new Proxy();
proxy.setProxyAutoconfigUrl("http://www.config.barclays.co.uk:9000/");
driver.close();
ieCapabilities. setCapability(CapabilityType.PROXY, proxy);
FirefoxDriver driver = new FirefoxDriver(ieCapabilities);
driver.get("https://login.salesforce.com");
driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
//Login to Salesforce Application
try
{
driver.findElement(By.id("username")).sendKeys(username);
driver.findElement(By.id("password")).sendKeys(password);
driver.findElement(By.id("Login")).click();
driver.manage().timeouts().implicitlyWait(75, TimeUnit.SECONDS);
}
catch(Exception e1)
{
System.out.println(e1 +"Your login attempt has failed. The username or password may be incorrect, or your location or login time may be restricted. Please contact the administrator at your company for help.");
}
}
public static void main(String[] args)
{
login.loginAs("me@example.com", "Pa$$word");
}
}
我试图单击销售队伍应用程序的机会选项卡的第二个文件:CreatOpportunity.java 这些行在我的主要论点下
LoginPage.login.loginAs("username", "password");
LoginPage.login.driver.findElement(By.id("Opportunity_Tab")).click();
运行我的第二个文件允许我启动我的应用程序,但没有检测到 Opprtunity 选项卡上的点击,并抛出上述错误