Skip to content
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

Deprecation warning from Selenium when using Select/Unselect Frame #592

Closed
ghost opened this issue Apr 15, 2016 · 2 comments
Closed

Deprecation warning from Selenium when using Select/Unselect Frame #592

ghost opened this issue Apr 15, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 15, 2016

Select Frame / Unselect Frame keywords are using deprecated switch_to_frame / switch_to_default_content

actual warning message:
/usr/lib/python2.6/site-packages/selenium/webdriver/remote/webdriver.py:536: DeprecationWarning: use driver.switch_to.frame instead
/usr/lib/python2.6/site-packages/selenium/webdriver/remote/webdriver.py:542: DeprecationWarning: use driver.switch_to.default_content instead

proposed fix:
change in keyword Select Frame
self._current_browser().switch_to_frame(element) into self._current_browser().switch_to.frame(element)

change in keyword Unselect Frame
self._current_browser().switch_to_default_content()
self._current_browser().switch_to.default_content()

@ghost
Copy link
Author

ghost commented Apr 15, 2016

there are some more locations which are using switch_to :
_element.py: browser.switch_to_frame(element)
_element.py: browser.switch_to_default_content()
_element.py: browser.switch_to_default_content()
_element.py: browser.switch_to_frame(frame)
_element.py: browser.switch_to_default_content()
_formelement.py: alert = self._current_browser().switch_to_alert()
_javascript.py: alert = self._current_browser().switch_to_alert()
_javascript.py: alert = self._current_browser().switch_to_alert()

as indicated fix is to replace underscore (_) with dot (.) after the text switch_to

@ghost ghost changed the title deprecation warning for select_frame / unselect_frame (with fix) deprecation warning for select_frame / unselect_frame Apr 17, 2016
@ghost
Copy link
Author

ghost commented May 6, 2016

Fix deprecation warning switch_to_frame #599

@aaltat aaltat added this to the v2.0 milestone Aug 29, 2016
@pekkaklarck pekkaklarck changed the title deprecation warning for select_frame / unselect_frame Deprecation warning from Selenium when using Select/Unselect Frame Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants