Skip to Content
Selenium WebDriver Recipes in C#: Practical Testing Solutions for Selenium WebDriver
book

Selenium WebDriver Recipes in C#: Practical Testing Solutions for Selenium WebDriver

by Courtney Zhan
December 2023
Intermediate to advanced content levelIntermediate to advanced
331 pages
4h 34m
English
Apress
Content preview from Selenium WebDriver Recipes in C#: Practical Testing Solutions for Selenium WebDriver
© Courtney Zhan, Edited by Zhimin Zhan 2024
Z. Zhan (ed.)Selenium WebDriver Recipes in C#https://doi.org/10.1007/979-8-8688-0023-8_7

7. CheckBox

Courtney Zhan1  
(1)
Fitzgibbon, QLD, Australia
 
Figure 7-1 shows a typical checkbox.

A checkbox offers options to select I have a bike and I have a car. A checkbox is ticked for I have a car.

Figure 7-1

Typical checkbox

HTML source:
<input type="checkbox" name="vehicle_bike" value="on" id="checkbox_bike">I have a bike<br/>
<input type="checkbox" name="vehicle_car" id="checkbox_car">I have a car

Check by Name

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

Check by Id

A checkbox, in fact, is a toggle. The first ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Selenium WebDriver Recipes in C#, Second Edition

Selenium WebDriver Recipes in C#, Second Edition

Zhimin Zhan

Publisher Resources

ISBN: 9798868800238Purchase LinkPublisher Website