-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreateLead1.java
More file actions
42 lines (35 loc) · 1.85 KB
/
CreateLead1.java
File metadata and controls
42 lines (35 loc) · 1.85 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
37
38
39
40
41
42
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 CreateLead1 {
public static void main(String[] args) throws InterruptedException {
WebDriverManager.chromedriver().setup();
ChromeDriver driver = new ChromeDriver();
driver.get("http://leaftaps.com/opentaps/control/login");
driver.manage().window().maximize();
WebElement eleUserName = driver.findElement(By.id("username"));
eleUserName.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("Sathyapriya");
driver.findElement(By.id("createLeadForm_lastName")).sendKeys("T");
driver.findElement(By.id("createLeadForm_firstNameLocal")).sendKeys("Local Name");
driver.findElement(By.id("createLeadForm_departmentName")).sendKeys("core department");
driver.findElement(By.id("createLeadForm_description")).sendKeys("Grow With Test Leaf");
driver.findElement(By.id("createLeadForm_primaryEmail")).sendKeys("sathyapriyat3@gmail.com");
WebElement eleSource=driver.findElement(By.id("createLeadForm_generalStateProvinceGeoId"));
Select obj=new Select(eleSource);
Thread.sleep(2000);
obj.selectByVisibleText("New York");
driver.findElement(By.name("submitButton")).click();
System.out.println("The tittle is :" +driver.getTitle());
driver.close();
}
}