Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 31 additions & 43 deletions week2/day2.assignments/CreateContact.java
Original file line number Diff line number Diff line change
@@ -1,53 +1,41 @@
package week2.day2.Assignments;
import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;


public class CreateContact {

public static void main(String[] args) {
ChromeDriver driver= new ChromeDriver();
driver.get("http://leaftaps.com/opentaps/control/login");
driver.manage().window().maximize();
driver.findElement(By.id("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("Contacts")).click();
driver.findElement(By.linkText("Create Contact")).click();
driver.findElement(By.id("firstNameField")).sendKeys("Muthu");
driver.findElement(By.id("lastNameField")).sendKeys("Lakshmi");
driver.findElement(By.id("createContactForm_firstNameLocal")).sendKeys("muthulakshmi");
driver.findElement(By.id("createContactForm_lastNameLocal")).sendKeys("gfsjry");
driver.findElement(By.id("createContactForm_departmentName")).sendKeys("Testing");
driver.findElement(By.id("createContactForm_description")).sendKeys("Validation checked");
driver.findElement(By.id("createContactForm_primaryEmail")).sendKeys("muthulakshmi2599@gmail.com");
driver.findElement(By.id("createContactForm_generalStateProvinceGeoId")).click();
Select stateDropDown=new Select(driver.findElement(By.id("createContactForm_generalStateProvinceGeoId")));
stateDropDown.selectByVisibleText("New York");
driver.findElement(By.name("submitButton")).click();
driver.findElement(By.linkText("Edit")).click();
driver.findElement(By.id("updateContactForm_description")).clear();
driver.findElement(By.id("updateContactForm_importantNote")).sendKeys("dhwieufb");
driver.findElement(By.xpath("//input[@name='submitButton']")).click();
String title = driver.getTitle();
System.out.println(title);


/*
* //Pseudo Code
*
* 1. Launch URL "http://leaftaps.com/opentaps/control/login"
*
* 2. Enter UserName and Password Using Id Locator
*
* 3. Click on Login Button using Class Locator
*
* 4. Click on CRM/SFA Link
*
* 5. Click on contacts Button
*
* 6. Click on Create Contact
*
* 7. Enter FirstName Field Using id Locator
*
* 8. Enter LastName Field Using id Locator
*
* 9. Enter FirstName(Local) Field Using id Locator
*
* 10. Enter LastName(Local) Field Using id Locator
*
* 11. Enter Department Field Using any Locator of Your Choice
*
* 12. Enter Description Field Using any Locator of your choice
*
* 13. Enter your email in the E-mail address Field using the locator of your choice
*
* 14. Select State/Province as NewYork Using Visible Text
*
* 15. Click on Create Contact
*
* 16. Click on edit button
*
* 17. Clear the Description Field using .clear
*
* 18. Fill ImportantNote Field with Any text
*
* 19. Click on update button using Xpath locator
*
* 20. Get the Title of Resulting Page.

*/

}

Expand Down