selenium frame元素定位
今天测试时,发现frame里的元素定位报错,无法找到。通过查找资料及尝试
用switch_to_frame可以解决
| switch_to_active_element(self)
| Deprecated use driver.switch_to.active_element
|
| switch_to_alert(self)
| Deprecated use driver.switch_to.alert
|
#切回默认
| switch_to_default_content(self)
| Deprecated use driver.switch_to.default_content
|
#切入所要查找元素的frame
| switch_to_frame(self, frame_reference)
| Deprecated use driver.switch_to.frame
|
| switch_to_window(self, window_name)
| Deprecated use driver.switch_to.window