新手学appium-python-client+appium api 2-SwitchTo

 1 from selenium.webdriver.remote.switch_to import SwitchTo
 2 
 3 from .mobilecommand import MobileCommand
 4 
 5 
 6 class MobileSwitchTo(SwitchTo):
 7     def context(self, context_name):
 8         """
 9         Sets the context for the current session.
10 
11         :Args:
12          - context_name: The name of the context to switch to.
13 
14         :Usage:
15             driver.switch_to.context('WEBVIEW_1')
16         """
17         self._driver.execute(MobileCommand.SWITCH_TO_CONTEXT, {'name': context_name})

 

posted @ 2015-05-08 22:00  Mr.Dantes  阅读(971)  评论(0编辑  收藏  举报