From the course: Advanced Selenium: Automation Frameworks

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Testing with Watir: Inputs

Testing with Watir: Inputs - Selenium Tutorial

From the course: Advanced Selenium: Automation Frameworks

Start my 1-month free trial

Testing with Watir: Inputs

- [Instructor] Now that we know our test will wait for the page to load, we'll move on to adding values to our input fields. Instead of adding a value to each and every field, we're going to work with one of each unique type of field on the form. Let's go ahead and reuse the selector for the first field by copying and pasting it. Make some room near the bottom. There we go. Now, we're going to call the set method and pass in a name as an argument. I used my name but you can use whatever you want. Now let's switch back to our browser. Go ahead and scroll to the dropdown selector labeled State. We'll inspect it. Notice that it has an ID of State. You can click the triangle icon next to the select element. You'll see all 50 states as options. Notice that each option has the state's name as text and it has a value that's the abbreviated name of the state. We'll go ahead and copy the state ID and switch back…

Contents