MinkSelenium2Driver icon indicating copy to clipboard operation
MinkSelenium2Driver copied to clipboard

switchToIframe not working with nested iframes.

Open clintFortinbras opened this issue 4 years ago • 2 comments

I have two iframes nested within each other. I find and switch to the first iframe. From there I can find but cannot switch to the second iframe i get the following error message

invalid selector: An invalid or illegal selector was specified (Session info: chrome=89.0.4389.90) (Driver info: chromedriver=89.0.4389.23 (61b08ee2c50024bab004e48d2b1b083cdbdac579-refs/branch-heads/4389@{#294}),platform=Mac OS X 10.15.6 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 18 milliseconds

clintFortinbras avatar Apr 02 '21 07:04 clintFortinbras

Any ideas ?

clintFortinbras avatar Apr 02 '21 14:04 clintFortinbras

@clintFortinbras , I've moved the issue from the general Mink repo to the MinkSelenium2Driver repo (based on an error message text) because it looks like a driver-specific issue.

Looking at https://www.guru99.com/handling-iframes-selenium.html proves, that Selenium does support nested iframes, but it's crucial to specify the correct argument to the method, that does frame switching to make it work. Maybe the page I've mentioned above will help you out or Google search results by selenium nested frames keyword.

To help others diagnose the issue please post a reproducible test case, that consists of:

  • used HTML files
  • used PHP code

.

Apologies for the late response.

aik099 avatar May 03 '21 10:05 aik099