目前我已經包含以下JAR文件來使用JAVA回放硒記錄。訪問Selenium類功能所需的Jar文件
- 的JUnit 4.10.jar
- 硒-java的2.24.1.jar
- 硒的服務器獨立-2.24.1.jar
而且我已經導入這些包
import com.thoughtworks.selenium.Selenium;
import java.util.NoSuchElementException;
import java.util.concurrent.TimeUnit;
import org.junit.After;
import static org.junit.Assert.fail;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.NoAlertPresentException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.support.ui.Select;
但是就這些而言,我無法訪問像getAlert()或getConfirmation()這樣的selenium類函數。
那麼有沒有我錯過的任何庫文件或JAR文件?
'getAlert()'和'getConfirmation()'都在'com.thoughtworks.selenium.DefaultSelenium'中實現,它包含在_selenium-java-2.24.1.jar_中。你得到了什麼確切的錯誤? – VolkerK 2012-07-27 10:44:19