Skip to content

Instantly share code, notes, and snippets.

@ShamaUgale
Created September 17, 2020 13:09
Show Gist options
  • Save ShamaUgale/7c057b0b2f37f240d749948c1c66fd99 to your computer and use it in GitHub Desktop.
Save ShamaUgale/7c057b0b2f37f240d749948c1c66fd99 to your computer and use it in GitHub Desktop.
package Tests;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
class GoogleSearchTest{
final static String PROJECT_PATH = System.getProperty("user.dir");
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", PROJECT_PATH+ "/chromedriver");
ChromeDriver driver = new ChromeDriver();
driver.get("https://www.google.com");
WebElement searchTxtBox = driver.findElement(By.name("q"));
searchTxtBox.sendKeys("Selenium 4" + Keys.ENTER);
driver.quit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment