2

現在、JAVA を使用してセレンの記録を再生するために、次の JAR ファイルを含めました。

  1. junit-4.10.jar
  2. セレン-java-2.24.1.jar
  3. セレン-サーバー-スタンドアロン-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() などのセレン クラス関数にアクセスできません。

見逃したライブラリ ファイルまたは JAR ファイルはありますか?

4

2 に答える 2

1

Selenium HQサイトからJavaクライアントドライバーパッケージ2.25.0をダウンロードしてから、 プロジェクトの参照ライブラリにすべてのjarを追加できます。

于 2012-08-30T12:07:05.140 に答える
0

com.thoughtworks.selenium パッケージにある DefaultSelenium クラスをインポートしていないので、この行をコードに追加すると機能します。

com.thoughtworks.selenium.DefaultSelenium をインポートします。

于 2012-08-28T06:48:52.803 に答える