-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExampleTestleaf.java
More file actions
49 lines (32 loc) · 1.5 KB
/
Copy pathExampleTestleaf.java
File metadata and controls
49 lines (32 loc) · 1.5 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
43
44
45
46
47
48
49
import java.sql.Driver;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;
public class ExampleTestleaf {
public static void main(String[] args) {
// TODO Auto-generated method stub\
ChromeDriver cc = new ChromeDriver();
cc.get("http://leaftaps.com/opentaps/");
cc.findElement(By.id("username")).sendKeys("demosalesmanager");
cc.findElement(By.id("Password")).sendKeys("crmsfa");
cc.findElement(By.id("login")).click();
cc.findElement(By.linkText("CRM/SFA"));
cc.findElement(By.partialLinkText("CRM")).click();
cc.findElement(By.linkText("Leads")).click();
cc.findElement(By.linkText("create Lead")).click();
cc.findElement(By.id("Company Name")).sendKeys("Testleaf");
cc.findElement(By.id("First Name")).sendKeys("Krishna chaitanya");
cc.findElement(By.id("Last Name")).sendKeys("Udayagiri");
WebElement select = cc.findElement(By.id("createLeadForm_dataSourceId"));
Select option = new Select(select);
option.selectByIndex(4);
WebElement select1 = cc.findElement(By.id("createLeadForm_marketingCampign"));
Select option1 = new Select(select1);
option1.selectByVisibleText("Automobile");
WebElement select2 = cc.findElement(By.id("createLeadForm_ownership"));
Select option2 = new Select(select2);
option2.deselectByValue("Corporation");
cc.findElement(By.name("Submit")).click();
}
}