Exemplo n.º 1
0
    public void CheckboxDiscovery()
    {
        Driver.Navigate().GoToUrl("http://the-internet.herokuapp.com/checkboxes");
        IReadOnlyCollection <IWebElement> Checkboxes = Driver.FindElements(By.CssSelector("input[type=\"checkbox\"]"));

        Console.Write("With .attribute('checked')");
        foreach (IWebElement Checkbox in Checkboxes)
        {
            Console.WriteLine(Checkbox.GetAttribute("checked"));
        }

        Console.WriteLine("With .selected?");
        foreach (IWebElement Checkbox in Checkboxes)
        {
            Console.WriteLine(Checkbox.Selected);
        }
    }