-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support switching to frame by index #8
Comments
It should already work, and actually the PR you linked to looks broken - it only handles index (id), or? public function switchToIFrame($name = null)
{
$this->getWebDriverSession()->frame(array('id' => $name));
} vs public function switchToIFrame(?string $name = null): void
{
$frameQuery = $name;
if ($name && $this->getWebDriver()->isW3cCompliant()) {
try {
$frameQuery = $this->getWebDriver()->findElement(WebDriverBy::id($name));
} catch (NoSuchElementException $e) {
$frameQuery = $this->getWebDriver()->findElement(WebDriverBy::name($name));
}
}
$this->getWebDriver()->switchTo()->frame($frameQuery);
} I'd be fine with replacing |
Looking at the json-wire link you provided it mentions:
It doesn't say anything about an index just "identifier", however it also mentions the ->switchToIFrame('xx'); // non-W3C mode / "old" mink logic, <iframe name=xx>
->switchToIFrame('xx'); // W3C mode, <iframe id=xx>
->switchToIFrame(1); // W3C mode, first <iframe> element <- this is broken case we're discussing now, right?
|
@uuf6429 , I've confirmed (by running a live test), that providing a number does switch to a I'm only concerned by the frame switching by index, because in Selenium 3 using MinkSelenium2Driver frame switching by name doesn't work at all. |
I guess that's because |
Long story short: I've managed to get it working by writing a code equivalent to the one used by this driver:
Thank you for the idea. |
Please improve the
switchToIFrame
method with frame/iframe switching support by an index. Currently, in the W3C-compliant mode, it doesn't work.Please see minkphp/Mink#866 for more info.
I would happily create PR similar to minkphp/MinkSelenium2Driver#378 as well.
The text was updated successfully, but these errors were encountered: