This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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