-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathInputs.java
More file actions
40 lines (26 loc) · 937 Bytes
/
Copy pathInputs.java
File metadata and controls
40 lines (26 loc) · 937 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package chapter5;
import org.openqa.selenium.Keys;
import org.openqa.selenium.chrome.ChromeDriver;
public class Inputs {
public static void main(String[] args) {
ChromeDriver driver = new ChromeDriver();
driver.get("https://letcode.in/");
driver.manage().window().maximize();
driver.get("https://letcode.in/edit");
// TC001
driver.findElementById("fullName").sendKeys("koushik Chatterjee");
// TC002
driver.findElementById("join").sendKeys(" Youtuber", Keys.TAB);
// TC003
String attribute = driver.switchTo()
.activeElement().getAttribute("value");
System.out.println(attribute);
// TC004
driver.findElementById("clearMe").clear();
boolean enabled = driver.findElementById("noEdit").isEnabled();
System.out.println(enabled);
String isReadOnly = driver.findElementById("dontwrite").getAttribute("readonly");
System.out.println(isReadOnly);
driver.quit();
}
}