课程: Test Automation with Selenium WebDriver for Java
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Solution: Find elements
(upbeat music) - [Speaker] The first element we need to locate is this image button. We see that it has an ID of image button, so we can find this element by its ID. The click button doesn't have an ID nor a name. It's a type of input, but so are many other elements on this page, so let's use a CSS selector as the locator strategy for this one. For the name text box, this element does not have an ID, but it does have a name, so we can use that and we'll add it to our code here. This was a great exercise in determining which locator strategy is best, depending on the attributes that are available to you in the dom.