-
Notifications
You must be signed in to change notification settings - Fork 163
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
Headless Chrome 79: Cannot switch to IFrame due "frame: invalid argument: 'id' can not be string" #315
Comments
According to JsonWireProtocol (see https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidframe) the frame name/id is a valid value. Not sure what ChromeDriver specifically doesn't like about it. The issue might w3c mode specific and you can try changing w3c mode via driver options (see nightwatchjs/nightwatch#2135 (comment)). Another option to try is also suggested in above referenced comment. Also try using |
Did you find a solution for this problem? I'm experiencing the same issue and can't get it to work. |
Same problem here |
I have the same problem with this Docker image selenium/standalone-chrome-debug i.e. no version number so I assume 'latest'. When I use selenium/standalone-chrome-debug:3.141.59-neon everything is fine. |
Interesting, I encountered the same issue while being on the latest beta version (4.0.0-beta-1-prerelease-20210114), downgrading to the most recent 3.x version (3.141.59) also didn't fix the issue. Switching to the neon version 3.141.59-neon did also solve the issue for me |
I tested a bit more, and selenium/standalone-chrome-debug:3.141.59-oxygen also does work, but everything after that version will not work. |
I had a similar problem using I switched to |
For those here, make sure you're passing w3c: false in your chrome options when creating the driver. |
can anyone elaborate is it an issue on MinkSelenium driver or selenium or chrome driver? |
Works with numerical ID being the index of the iframe on the page: /**
* Assert that content is present in an iframe.
*
* @Then I see content in iframe with id :id
*/
public function iSeeContentInIframe($id) {
$driver = $this->getSession()->getDriver();
if (!$driver instanceof Selenium2Driver) {
throw new RuntimeException('Unsupported driver for this step');
}
$index = NULL;
$iframe_elements = $driver->find('//iframe');
if (!empty($iframe_elements)) {
foreach ($iframe_elements as $k => $all_page_iframe_element) {
if ($all_page_iframe_element->getAttribute('id') == $id) {
$index = $k;
break;
}
}
}
if (is_null($index)) {
throw new ElementNotFoundException($driver, 'iFrame', $id);
}
$driver->switchToIFrame($index);
if (!$driver->find('//body')) {
throw new Exception(sprintf('The contents of the iFrame with id "%s" was not loaded', $id));
}
// Reset frame to the default window.
$driver->switchToIFrame();
} |
The issue will be fixed in #382. |
Hi,
I am trying to switch into an iframe, but I cannot in the current headless Chrome version. Looks like a faulty interface is being used in the following method which accepts a string, but should accept an (DOM)-object:
\Behat\Mink\Driver\Selenium2Driver::switchToIFrame()
Since I am getting the following error from my Chromedriver:
Other testing libraries are also complying about such a change: nightwatchjs/nightwatch#2135
Do you know how to solve that? Is there any updated version is the build?
The text was updated successfully, but these errors were encountered: