0
내가 Webdriver셀레늄
엉 자바, 셀레늄을 사용하여 내가 사용하는 새로운 해요 : 셀레늄 3 베타 3, 자바 jdk1.8.0_101와 파이어 폭스 48.01 또한 나는 Geckodriver 사용 이는 sel3을 사용하는 데 필요하기 때문입니다.
URL을 열려고합니다. 브라우저를 여는 중입니다. 내가 사용하는 코드는 다음과 같습니다.
package AutomatedScripts;
import org.openqa.selenium.WebDriver; // driver for Webdriver
import org.openqa.selenium.firefox.FirefoxDriver; //driver for Firefox
public class GoogleSearchOneTime {
public static void main(String[] agrs) {
System.setProperty("webdriver.firefox.marionette","C:\\selenium-3.0.0\\geckodriver\\geckodriver.exe");
// Launch a firefox browser
WebDriver driver = new FirefoxDriver();
// go to Google.com
driver.get("http://www.google.com");
// go to google.com
// driver.navigate().to("http://www.google.com");
//Enter search terms
//driver.findElement(By.id("lst-ib")).clear();
//driver.findElement(By.id("lst-ib")).sendKeys("Google");
//Click on the searh button
//driver.findElement(By.name("btnG")).click();
//check page title contacts the search term
}
}