CSS Selector-How To Locate Parent Element
Answer : Referring to the Is there a CSS parent selector? topic, there is no parent selector in CSS . Leave the "getting the parent" part to the XPath: WebElement we = dr.findElement(By.cssSelector("div[id='gf-BIG']")); WebElement parent = we.findElement(By.xpath(".."));