Tôi là một newbie với webdriver và cần một số giúp đỡ ..Không thể kết nối để lưu trữ 127.0.0.1 trên cổng 7055
Tôi đang sử dụng Selenium 2.2.0 với FF v7.0.1 trên Windows XP
tôi đã quản lý để ghi lại và phát lại một kịch bản java thành công trong IE nhưng bất cứ khi nào tôi thử và thực hiện cùng một tập lệnh trong FF, tôi nhận được thông báo lỗi sau:
Không thể kết nối với máy chủ 127.0.0.1 trên cổng 7055 sau 45000 ms
Tôi đã đọc ở số lượng địa điểm nếu tôi hạ cấp f irefox phiên bản 3.6 script sẽ làm việc tốt tuy nhiên tôi không phải quan tâm về hạ cấp. Ai đó có thể cho tôi biết tôi đang làm gì sai không?
package hisScripts;
import java.util.concurrent.TimeUnit;
import org.junit.*;
import static org.junit.Assert.*;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
public class WebdriverTest_1 {
private WebDriver driver;
private String baseUrl;
private StringBuffer verificationErrors = new StringBuffer();
@Before
public void setUp() throws Exception {
driver = new FirefoxDriver();
//driver=new InternetExplorerDriver();
baseUrl = "https://**********/";
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
@Test
public void testUntitled() throws Exception {
driver.get(baseUrl + "/");
driver.findElement(By.xpath("//a[contains(text(),'my profile')]")).click();
driver.findElement(By.xpath("//a[contains(text(),'about the service')]")).click();
driver.findElement(By.xpath("//a[contains(text(),'contact us')]")).click();
driver.findElement(By.xpath("//a[contains(text(),'help')]")).click();
driver.findElement(By.xpath("//a[contains(text(),'home')]")).click();
driver.findElement(By.xpath("//a[contains(text(),'logout')]")).click();
}
@After
public void tearDown() throws Exception {
driver.quit();
String verificationErrorString = verificationErrors.toString();
if (!"".equals(verificationErrorString)) {
fail(verificationErrorString);
}
}
private boolean isElementPresent(By by) {
try {
driver.findElement(by);
return true;
} catch (NoSuchElementException e) {
return false;
}
}
}
Mã là ok. Điều gì về nâng cấp? Từ FF7 đến, nói, FF9 hay 10? Selen không thể hoạt động tốt với FF11 (cho đến nay), nhưng FF9 hoạt động tốt! –
@slanec - Tôi đã nâng cấp lên FFv10.0.2 nhưng vẫn không có niềm vui - iS có bất kỳ điều gì khác mà tôi có thể làm để giải quyết vấn đề này? – user929258
Tuyệt đối không có ý tưởng = (. –