I was facing an issue where the chromedriver was unable to find element by id eventhough the values were correct. So I added the below step
#switch into iframe
driver.switch_to.frame("frameid")
This is the error message now
'ChromeDriver' object has no attribute 'switch_to'
chromedriver=81.0.4044.69 chromeversion=81.0.4044.92
Is it because of the older version of chrome being used?
CodePudding user response:
As per the Selenium Python Changelog:
Selenium 2.41
* Support for Firefox 28
* deprecating switch_to_* in favour of driver.switch_to.*
So you were pretty right analyzing the error which was because of older version of chromedriver/chrome combo being used.
Solution
Ensure that:
- Selenium is upgraded to current released Version 4.3.0.
- ChromeDriver is updated to current ChromeDriver v103.0 level.
- Chrome Browser is updated to current chrome=103.0 (as per chromedriver=102.0.5005.61 release notes).