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文件具有登錄功能,第二個在登錄後創建了一個新帳戶 請注意。Selenium webdriver腳本中的UnreachableBrowserException
Login.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("[email protected]", "Pa$$word");
}
}
在那裏我試圖點擊我的銷售隊伍應用程序的機會標籤上的第二個文件: CreatOpportunity.java這些線是在我的主要論點
LoginPage.login.loginAs("username", "password");
LoginPage.login.driver.findElement(By.id("Opportunity_Tab")).click();
運行我的第二個文件允許我啓動我的應用程序,但沒有檢測到對話標籤上的點擊並引發上述錯誤
只有在此腳本中出現此錯誤或任何腳本?如果對於每個腳本嘗試重新啓動您的所有瀏覽器實例 – vkrams
我面臨的所有錯誤消息:Foreg:LoginPage.login.loginAs(「user name」,「Password」); 。LoginPage.driver.findElement(By.id( 「Opportunity_Tab」))點擊();然後我得到相同的錯誤,這裏loginPage幫助我登錄到應用程序,第二行是導航到應用程序的機會部分。請告知 – user1834699
您能否粘貼您的代碼 – vkrams