-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDuplicateLead.java
49 lines (44 loc) · 2.41 KB
/
DuplicateLead.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
39
40
41
42
43
44
45
46
47
48
49
package Week2.Day1;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;
import io.github.bonigarcia.wdm.WebDriverManager;
public class DuplicateLead {
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
WebDriverManager.chromedriver().setup();
String driverpath = System.getProperty("webdriver.chrome.driver");
System.out.println(driverpath);
ChromeDriver driver = new ChromeDriver();
driver.get("http://leaftaps.com/opentaps/control/main");
driver.manage().window().maximize();
WebElement userName = driver.findElement(By.id("username"));
userName.sendKeys("DemoSalesManager");
driver.findElement(By.id("password")).sendKeys("crmsfa");
driver.findElement(By.className("decorativeSubmit")).click();
driver.findElement(By.linkText("CRM/SFA")).click();
driver.findElement(By.linkText("Leads")).click();
driver.findElement(By.linkText("Create Lead")).click();
driver.findElement(By.id("createLeadForm_companyName")).sendKeys("Testleaf");
driver.findElement(By.id("createLeadForm_firstName")).sendKeys("Thenmozhi");
driver.findElement(By.id("createLeadForm_lastName")).sendKeys("B");
driver.findElement(By.id("createLeadForm_firstNameLocal")).sendKeys("Thenmozhi Balaji");
driver.findElement(By.id("createLeadForm_departmentName")).sendKeys("Testing");
driver.findElement(By.id("createLeadForm_description")).sendKeys("TestLeaf week2 Day1 Assignment");
driver.findElement(By.id("createLeadForm_primaryEmail")).sendKeys("[email protected]");
WebElement eleAt = driver.findElement(By.id("createLeadForm_generalStateProvinceGeoId"));
Select dd = new Select(eleAt);
dd.selectByVisibleText("New York");
driver.findElement(By.name("submitButton")).click();
driver.findElement(By.linkText("Duplicate Lead")).click();
driver.findElement(By.id("createLeadForm_companyName")).clear();
driver.findElement(By.id("createLeadForm_companyName")).sendKeys("Test1leaf Co");
driver.findElement(By.id("createLeadForm_firstName")).clear();
driver.findElement(By.id("createLeadForm_firstName")).sendKeys("Thenu");
driver.findElement(By.name("submitButton")).click();
Thread.sleep(5000);
System.out.println("After create duplicate lead,the page title is : " +driver.getTitle());
driver.close();
}
}