Skip to content

Instantly share code, notes, and snippets.

@ksakae1216
Last active June 13, 2016 07:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ksakae1216/f29df03948a96e8015497fa106c59f75 to your computer and use it in GitHub Desktop.
package webDriverSample;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class SeleniumWebDriver {
public static void main(String[] args) throws Exception {
System.setProperty("webdriver.chrome.driver", "driver/chromedriver");
WebDriver driver = new ChromeDriver();
driver.get("https://www.google.co.jp/");
WebElement element = driver.findElement(By.name("q"));
element.sendKeys("フリーランス チャレンジ selenium"); //検索文字をセット;
element.submit();
// driver.quit(); //ブラウザ閉じる
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment