Element-34/php-webdriver — pull request #11 by wheelsandcogs (2012-07-19 10:01:59+00:00)
Title: is_a() check for WebDriverSession prevents access of nested elements

This check for the session object prevents you from nesting queries.

Consider the following html:

```html

Row 1 Cell 1
Row 1 Cell 2
Row 1 Cell 3

Row 2 Cell 1
Row 2 Cell 2
Row 2 Cell 3

Row 3 Cell 1
Row 3 Cell 2
Row 3 Cell 3

```

Now lets loop through each row and handle the cells:

```php
elements("css selector", "table#example > tbody > tr");

foreach ($rows as $row) {
// currently returns empty array due to
// is_a($this, "PHPWebDriver_WebDriverSession") check
// in WebDriverContainer::webDriverElement()
$cells = $row->elements("css selector", "td");
}
```

The check isn't in the original Facebook driver - so I'm assuming it was added for a reason, but I can't work out why?