-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWeek2_CreateAccount
More file actions
47 lines (39 loc) · 1.99 KB
/
Week2_CreateAccount
File metadata and controls
47 lines (39 loc) · 1.99 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
package Week2.day2;
import java.time.Duration;
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 Createaccount {
public static void main(String[] args) {
ChromeDriver driver = new ChromeDriver();
driver.get("http://leaftaps.com/opentaps/control/main");
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(30));
driver.findElement(By.id("username")).sendKeys("DemoCSR");
driver.findElement(By.id("password")).sendKeys("crmsfa");
driver.findElement(By.className("decorativeSubmit")).click();
WebElement crmsfa = driver.findElement(By.linkText("CRM/SFA"));
System.out.println(crmsfa.getText());
crmsfa.click();
driver.findElement(By.xpath("//a[contains(text(),'Create Account')]")).click();
WebElement x = driver.findElement(By.xpath("//input[@id='accountName']"));
x.sendKeys("Learn Selenium");
driver.findElement(By.xpath("//textarea[@name='description']")).sendKeys("Selenium Automation Tester");
Select industry = new Select(driver.findElement(By.xpath("//select[@name='industryEnumId']")));
industry.selectByValue("IND_SOFTWARE");
Select ownership = new Select(driver.findElement(By.xpath("//select[@name='industryEnumId']")));
ownership.selectByVisibleText("S-Corporation");
Select source = new Select(driver.findElement(By.xpath("//select[@name='industryEnumId']")));
source.selectByValue("LEAD_EMPLOYEE");
Select mc = new Select(driver.findElement(By.xpath("//select[@id='marketingCampaignId']")));
mc.selectByIndex(5);
Select state = new Select(driver.findElement(By.xpath("//select[@id='generalStateProvinceGeoId']")));
state.selectByValue("TX");
driver.findElement(By.xpath("//input[@class='smallSubmit']")).click();
WebElement Account = driver.findElement(By.xpath("//tbody/tr/td[2]/span[@class='tabletext']"));
String a = Account.getText();
System.out.println(a);
driver.close();
}
}