public void LocatingThingsByNonId()
        {
            using (var browser =
                new IE("http://localhost:62727/Pages/ApplyForCreditCard.aspx"))
            {
            Div errorContainer = browser.Div(Find.ByClass("error"));

            SelectList title = browser.SelectList(Find.ByName("Title"));

            Label ageLabel = browser.Label(Find.ByFor("Age"));
            TextField applicantAge = browser.TextField(Find.ByLabelText("Age In Years"));

            TextField applicantAge2 = browser.TextField(Find.By("id", "Age"));

               // var something = browser.Div(Find.By("someattribute","somevalue"));
               // Assert.That(something, Is.Not.Null);

               //     Link helpHyperlink = browser.Link(Find.ById("HelpLink"));

             //   Button applyButton = browser.Button(Find.ById("ApplyNow"));

               // Para nameParagraph = browser.Para(Find.ById("Name"));
            }
        }
Example #2
0
 public static void SelectCheckBoxByName(IE ieInstance, string selectedValue)
 {
     CheckBoxCollection cbCollection = ieInstance.CheckBoxes;
     foreach (CheckBox cb in cbCollection)
     {
         if (selectedValue != ieInstance.Label(Find.ByFor(cb.Id)).Text) continue;
         cb.Checked = true;
         break;
     }
 }