Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.