oleg-andreyev / MinkPhpWebDriver

Webdriver driver for Mink framework
MIT License
8 stars 9 forks source link

switchToIframe uses 'name' as reference instead of 'id' #34

Closed jfassembly closed 3 years ago

jfassembly commented 3 years ago

The current implementation of switchToIframe is using name instead of id. This behavior is not abiding by the W3C specification, which requests for id to be used.

Would you be open to adapt the behavior? I can whip a short PR to get this compliant.

oleg-andreyev commented 3 years ago

@jfassembly Thanks for bringing this up.

’switchToIframe’ is not a direct implementation of W3C Specification, its a wrapper over php-webdriver. If you go to php-webdriver and take a look at lib/Remote/RemoteTargetLocator.php you'll notice that it's using ID so is compliant with W3C.

Probably it worth implementing a second version of ’switchToIframe’ that will search element by id (attribute)