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])
| 22 | |
| 23 | class 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 |