'WebDriver' object has no attribute 'switch_to_context'

contexts ['NATIVE_APP', 'WEBVIEW_com.wondershare.drfone']

    driver.switch_to_context(webview)

AttributeError: 'WebDriver' object has no attribute 'switch_to_context'

发生以上的错误是因为switch_to.contex ,写成switch_to_context,正确用法:

driver.switch_to.context('WEBVIEW_com.wondershare.drfone')

你可能感兴趣的:('WebDriver' object has no attribute 'switch_to_context')