Permalink
Browse files

Need to fetch the element again after reloading the DOM

  • Loading branch information...
1 parent 0d4a8dc commit 5667557d9d1a0ec51c9c1fe4bdf242a9fd09cae6 @chibimagic committed Mar 8, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 WebDriver/WebElement.php
View
3 WebDriver/WebElement.php
@@ -294,7 +294,8 @@ public function assert_text_reload($expected_text) {
$end_time = time() + WebDriver::$ImplicitWaitMS/1000;
do {
$this->driver->reload();
- $actual_text = $this->get_text();
+ $element_in_new_dom = $this->driver->get_element($this->locator);
+ $actual_text = $element_in_new_dom->get_text();
} while (time() < $end_time && $actual_text != $expected_text);
PHPUnit_Framework_Assert::assertEquals($expected_text, $actual_text, "Failed asserting that <{$this->locator}>'s text is <$expected_text> after " . WebDriver::$ImplicitWaitMS/1000 . " seconds.");
}

0 comments on commit 5667557

Please sign in to comment.