MCPcopy
hub / github.com/appium/python-client / context

Method context

appium/webdriver/switch_to.py:24–35  ·  view source on GitHub ↗

Sets the context for the current session. Passing `None` is equal to switching to native context. Args: context_name: The name of the context to switch to. Usage: driver.switch_to.context('WEBVIEW_1')

(self, context_name: Optional[str])

Source from the content-addressed store, hash-verified

22
23class MobileSwitchTo(SwitchTo):
24 def context(self, context_name: Optional[str]) -> Self:
25 """Sets the context for the current session.
26 Passing `None` is equal to switching to native context.
27
28 Args:
29 context_name: The name of the context to switch to.
30
31 Usage:
32 driver.switch_to.context('WEBVIEW_1')
33 """
34 self._driver.execute(MobileCommand.SWITCH_TO_CONTEXT, {'name': context_name})
35 return self

Callers 4

test_contextFunction · 0.45
test_navigationFunction · 0.45

Calls 1

executeMethod · 0.45

Tested by 4

test_contextFunction · 0.36
test_navigationFunction · 0.36