CHAPTER 7

image

Check Box

Check boxes are common elements in user interfaces. An example is shown in Figure 7-1.

9781484217412_Fig07-01.jpg

Figure 7-1. An example of check boxes

Check by name

driver.FindElement(By.Name("vehicle_bike")).Click();

Check by ID

Clicking a check box, in fact, is a toggle: The first click selects the check box and the next one clears it. The following test statements make sure a ...

Get Selenium WebDriver Recipes in C#, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.