Iframe switch - Send element info as selenium 4 require it #361
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When I try to switch to an iframe with the switchToIframe method I receive the following error:
invalid argument: 'id' can not be string
Steps to reproduce
Call the method 'switchToIframe' method of the Selenium2DriverClass passing the 'id' of the iframe it is needed to switch to as a string:
Proposed resolution
According to the current specs , it must be an object that contains the element ID inside. So, in the switchToIframe method, we must change the format to send the element ID (UUID) of the element we are switching to, instead of the plain id passed by arguments. When the name of the iframe passed is null, we must send nothing.
Currently, this solution makes the library not compatible with selenium 3, but as far as I understand selenium 4 is stable so it should be replaced.