Selecting radio buttons, checkboxes, and switches

To select radio buttons, checkboxes, and switches, use I.select.

Let's try checking the "Remember Me" box when we sign in to Twitter.

I.goTo("https://twitter.com")
I.click("Log in")
I.fill("Email", "john@example.com")
I.fill("Password", "supersecretpassword")
I.select("Remember me")I.click("Log in")
I.see("We could not identify you by the email address.")

You can also deselect checkboxes and switches with I.deselect:

I.goTo("https://twitter.com")
I.click("Log in")
I.fill("Email", "john@example.com")
I.fill("Password", "supersecretpassword")
I.deselect("Remember me")
I.click("Log in")I.see("We could not identify you by the email address.")

Sometimes you might have lists of radio buttons or checkboxes with the same options like this:

You'll need to specify the list and the option.

I.goTo("https://example.uilicious.com/rgb_boxes.html")
I.select("Left color", "Blue")I.see("Left is blue")
I.select("Right color", "Green")I.see("Right is green")

When you are ready, click Next below.