Skip to content

Commit f05c5c2

Browse files
authored
[switchToIFrame] Undefined variable: els (#12)
1 parent 9ee5410 commit f05c5c2

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/Codeception/Module/WebDriver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,6 +2539,7 @@ public function switchToIFrame($locator = null)
25392539
$this->webDriver->switchTo()->defaultContent();
25402540
return;
25412541
}
2542+
$els = null;
25422543
try {
25432544
$els = $this->_findElements("iframe[name='$locator']");
25442545
} catch (\Exception $e) {

tests/web/WebDriverTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,8 @@ public function testSwitchToIframe()
10971097
$this->module->see('Lots of valuable data here');
10981098
$this->module->switchToIFrame();
10991099
$this->module->see('Iframe test');
1100+
$this->module->switchToIFrame("//iframe[@name='content']");
1101+
$this->module->see('Lots of valuable data here');
11001102

11011103
}
11021104

0 commit comments

Comments
 (0)