I need to get all elements with a class inside a wrapper div. I have done this before with php and the css selector would look something like this:
$this->elements($this->using('css selector')->value('div.active tr[class="theRow"]'));
Now this would give me all foo elements inside the wrapper active but I dont know how to do it with Java. I want a list with all the webElements like so:
List<WebElement> list = driver.findElements(By.cssSelector(".active,.theRow"));
This however will give me all theRow elements, eaven those outside the active wrapper. any sugestions?
the code below also give all theRow elements as expected:
List<WebElement> list = driver.findElements(By.className("theRow"));
but this gives me a empty list
List<WebElement> list = driver.findElements(By.cssSelector("tr[class='row-hover']"));
div.active span[class="foo"]
– Arran Aug 27 '13 at 11:06