We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e6de3f commit ca75910Copy full SHA for ca75910
src/Codeception/Module/WebDriver.php
@@ -2547,11 +2547,14 @@ public function switchToIFrame($locator = null)
2547
try {
2548
$els = $this->_findElements("iframe[name='$locator']");
2549
} catch (\Exception $e) {
2550
+ $this->debug('Failed to find locator by name: ' . $e->getMessage());
2551
+ }
2552
+ if (!is_array($els) || !count($els)) {
2553
$this->debug('Iframe was not found by name, locating iframe by CSS or XPath');
2554
$els = $this->_findElements($locator);
2555
}
2556
if (!count($els)) {
- throw new ElementNotFound($selector, "Iframe was not found by CSS or XPath");
2557
+ throw new ElementNotFound($locator, 'Iframe');
2558
2559
$this->webDriver->switchTo()->frame($els[0]);
2560
0 commit comments