Пример #1
0
        public void ContactCreationTest()
        {
            ContactForm contact = new ContactForm("Tatiana");

            contact.Midname   = "Aleksandrovna";
            contact.Lname     = "Kornilova";
            contact.Photo     = "D:\\xampp\\htdocs\\addressbook\\201809291637213031.jpg";
            contact.Bday      = "29";
            contact.Bmonth    = "March";
            contact.Byear     = "1983";
            contact.Groupname = "Group name";
            app.Groups
            .AddNewContact()
            .FillInContactForm(contact)
            .SubmitContactCreation();
            app.Navigator.ReturnToHomepage();
        }
Пример #2
0
 public GroupHelper FillInContactForm(ContactForm contact)
 {
     driver.FindElement(By.Name("firstname")).Click();
     driver.FindElement(By.Name("firstname")).Clear();
     driver.FindElement(By.Name("firstname")).SendKeys(contact.Fname);
     driver.FindElement(By.Name("middlename")).Clear();
     driver.FindElement(By.Name("middlename")).SendKeys(contact.Midname);
     driver.FindElement(By.Name("lastname")).Clear();
     driver.FindElement(By.Name("lastname")).SendKeys(contact.Lname);
     driver.FindElement(By.Name("photo")).SendKeys(contact.Photo);
     driver.FindElement(By.Name("bday")).Click();
     new SelectElement(driver.FindElement(By.Name("bday"))).SelectByText(contact.Bday);
     new SelectElement(driver.FindElement(By.Name("bmonth"))).SelectByText(contact.Bmonth);
     driver.FindElement(By.Name("byear")).Clear();
     driver.FindElement(By.Name("byear")).SendKeys(contact.Byear);
     //Thread.Sleep(1000);
     driver.FindElement(By.Name("new_group")).Click();
     new SelectElement(driver.FindElement(By.Name("new_group"))).SelectByText(contact.Groupname);
     return(this);
 }