Created
September 17, 2020 13:09
-
-
Save ShamaUgale/7c057b0b2f37f240d749948c1c66fd99 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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