phpseleniumiframebehat

"invalid argument: 'id' can not be string" when trying to switchToIFrame() in PHP


    public function switchActionScopeToIframe($name)
    {
        $this->getdriver()->switchToIFrame($name);
    }

$this->switchActionScopeToIframe("my-iframe-name");

I've also tried to do this from getSession(). Same result.
I've also tried with other selectors. Same result.
I've also tried to index like switchToIFrame(1); since my iframe is the second one. No error on this one, but then it doesn't find any elements inside the iframe, like fields.
I've also tried to rename the iframe myself with javascript. Same result.


Solution

  • It worked after adding this to the behat.yml

            capabilities:
              extra_capabilities:
                goog:chromeOptions:
                  w3c: false