-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMyAccount.java
38 lines (24 loc) · 1.23 KB
/
MyAccount.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
31
32
33
34
35
36
37
38
package finalproject;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class MyAccount {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver", "C:\\Users\\DARSHANA\\Downloads\\chromedriver_win32 (1)\\chromedriver.exe");
WebDriver w= new ChromeDriver ();
w.get("http://tutorialsninja.com/demo/");
w.findElement(By.xpath("//*[@id=\"top-links\"]/ul/li[2]/a")).click();
w.findElement(By.linkText("Register")).click();
w.findElement(By.name("firstname")).sendKeys("Darshu");
w.findElement(By.name("lastname")).sendKeys("paniya");
w.findElement(By.name("email")).sendKeys("[email protected]");
w.findElement(By.name("telephone")).sendKeys("9874561230");
w.findElement(By.name("password")).sendKeys("123456");
w.findElement(By.name("confirm")).sendKeys("123456");
w.findElement(By.name("newsletter")).click();
w.findElement(By.name("agree")).click();
w.findElement(By.xpath("//*[@id=\"content\"]/form/div/div/input[2]")).click();
w.findElement(By.xpath("//*[@id=\"content\"]/div/div/a")).click();
}
}