• Class name webDriver.findElements(By.className("sponsor_logos")); • CSS Selector webDriver.findElement(By.cssSelector("section#sponsor>p")); • XPath webDriver.findElement(By.xpath("//section[@id=‘miniconfs’]/a[2]")); • Link Text webDriver.findElements(By.linkText("About")); • Partial Link Text webDriver.findElement(By.partialLinkText("visitcanberra")); Locator Strategies Monday, 3 June 13
target = webDriver.switchTo(); WebElement element = target.frame(“name”) Alert alert = target.alert(); Navigation Class To navigate like in a browser Navigation nav = webDriver.navigate(); nav.back(); / nav.forward(); nav.to(“url”); TargetLocator Class and Navigation Class Monday, 3 June 13