26、
上下文
获取当前上下文
context = driver.current_context
或者
context = driver.context
获取所有上下文
contexts = driver.contexts
设置当前上下文
webview = driver.contexts[1]
driver.switch_to.context(webview)
# ...
driver.switch_to.context('NATIVE_APP')
27、
鼠标
将鼠标移至
actions = ActionChains(driver)
actions.move_to(element, 10, 10)
actions.perform()
在当前鼠标坐标点击任意鼠标按钮
actions = ActionChains(driver)
actions.move_to_element(element)
actions.click()
actions.perform()
双击当前鼠标坐标(由moveto设置)
actions = ActionChains(driver)
actions.move_to_element(element)
actions.double_click()
actions.perform()
按钮关闭
在当前的鼠标坐标上单击并按住鼠标左键
actions = ActionChains(driver)
actions.move_to_elem