-
Notifications
You must be signed in to change notification settings - Fork 0
/
EditBox.java
30 lines (24 loc) · 1.12 KB
/
EditBox.java
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
package week2.day1;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
public class EditBox {
public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriverManager.chromedriver().setup();
ChromeDriver driver = new ChromeDriver();
driver.get("http://testleaf.herokuapp.com/pages/Edit.html");
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.findElementById("email").sendKeys("aravindraman440@gmail.com");
driver.findElementByXPath("//input[@value='Append ']").sendKeys("TEXT");
String text = driver.findElementByXPath("//input[@value='TestLeaf']").getAttribute("value");
System.out.println(text);
driver.findElementByXPath("//input[@value='TestLeaf']").sendKeys("ARAVIND");
driver.findElementByXPath("//input[@value='Clear me!!']").clear();
boolean displayed = driver.findElementByXPath("//input[@disabled='true']").isDisplayed();
System.out.println(displayed);
}
}