私はSeleniumを使い始めようとしています。私はSelenium Stand Alone Server、Selenium for JAVA、GeckoDriverをダウンロードしました。スタンドアローンサーバーとSelenium for JAVAのすべての.jarファイルをEclipseのビルドパスに追加しました。私は私のプログラムを実行すると、私はfollwingエラーを取得する:Seleniumをどのように使い始めることができますか?
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
FirefoxOptions cannot be resolved to a type
FirefoxOptions cannot be resolved to a type
at check.Selenium_Basic.main(Selenium_Basic.java:14)
私のコードは以下の通りです:これが動作しない理由を
package check;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;
public class Selenium_Basic {
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver", "C:\\Users\\User1\\Documents\\geckodriver-v0.16.1-win32\\geckodriver.exe");
FirefoxOptions options = new FirefoxOptions();
options.setBinary("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"); //This is the location where you have installed Firefox on your machine
FirefoxDriver driver = new FirefoxDriver(options);
driver.get("http://www.google.com");
}
}
は、あなたたちは知っていますか?私はこれを使用し始めることができるステップガイドで良いステップがありますか?私は多くのガイドを見てきましたが、私が間違って行ったことを理解することはできません。
することで、必要なファイルやビルド・パスが欠落しているようです間違っています。 – csmckelvey
そのクラスのインポートはどうですか? – Tom