-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathKeyBoardKeys.java
More file actions
25 lines (19 loc) · 915 Bytes
/
Copy pathKeyBoardKeys.java
File metadata and controls
25 lines (19 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package main.webdriver;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
/**
* Created by Neeraj on 31-12-2016.
*/
public class KeyBoardKeys {
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver", System.getProperty("user.dir") + "\\GecoDriver\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.get("http://automationpractice.com/index.php?controller=authentication&back=my-account");
driver.findElement(By.xpath(".//*[@id='passwd']")).sendKeys("test23");
driver.findElement(By.xpath(".//*[@id='SubmitLogin']")).sendKeys(Keys.ENTER); // Press Enter button on Submit button.
}
}