-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeyboardAc1.java
More file actions
36 lines (27 loc) · 1.28 KB
/
KeyboardAc1.java
File metadata and controls
36 lines (27 loc) · 1.28 KB
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
26
27
28
29
30
31
32
33
34
35
36
package VINDVG1.Vinay27;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
public class KeyboardAc1 {
public static void main(String[] args) {
WebDriverManager.chromedriver().setup();
WebDriver driver = new ChromeDriver();
driver.get("https://demoqa.com/text-box");
driver.manage().window().maximize();
Actions Vinay = new Actions(driver);
driver.findElement(By.id("userName")).sendKeys("Vinay Kumar");
driver.findElement(By.id("userEmail")).sendKeys("salkattevinay@gmail.com");
driver.findElement(By.id("currentAddress")).sendKeys("Davangare-Bangalore-Mysore");
Vinay.keyDown(Keys.CONTROL).sendKeys("a").keyUp(Keys.CONTROL).build().perform();
Vinay.keyDown(Keys.CONTROL).sendKeys("c").keyUp(Keys.CONTROL).build().perform();
Vinay.sendKeys(Keys.TAB);
driver.findElement(By.id("permanentAddress"));
Vinay.keyDown(Keys.CONTROL).sendKeys("v").keyUp(Keys.CONTROL).build().perform();
driver.findElement(By.xpath("//*[@id=\"submit\"]")).click();
System.out.println("Script Sucess");
}
}