@@ -18,7 +18,7 @@ def __init__(self):
18
18
# Public, open and close
19
19
20
20
def close_application (self ):
21
- """Closes the current application."""
21
+ """Closes the current application and also close webdriver session ."""
22
22
self ._debug ('Closing application with session id %s' % self ._current_application ().session_id )
23
23
self ._cache .close ()
24
24
@@ -81,8 +81,46 @@ def switch_application(self, index_or_alias):
81
81
self ._cache .switch (index_or_alias )
82
82
return old_index
83
83
84
+ def launch_application (self ):
85
+ """ Launch application. Application can be launched while Appium session running.
86
+ This keyword can be used to launch application during test case or between test cases.
87
+
88
+ This keyword works while `Open Application` has a test running. This is good practice to `Launch Application`
89
+ and `Quit Application` between test cases. As Suite Setup is `Open Application`, `Test Setup` can be used to `Launch Application`
90
+
91
+ Example (syntax is just a representation, refer to RF Guide for usage of Setup/Teardown):
92
+ | [Setup Suite] |
93
+ | | Open Application | http://localhost:4723/wd/hub | platformName=Android | deviceName=192.168.56.101:5555 | app=${CURDIR}/demoapp/OrangeDemoApp.apk |
94
+ | [Test Setup] |
95
+ | | Launch Application |
96
+ | | | <<<test execution>>> |
97
+ | | | <<<test execution>>> |
98
+ | [Test Teardown] |
99
+ | | Quit Application |
100
+ | [Suite Teardown] |
101
+ | | Close Application |
102
+
103
+ See `Quit Application` for quiting application but keeping Appium sesion running.
104
+
105
+ New in AppiumLibrary 1.4.6
106
+ """
107
+ driver = self ._current_application ()
108
+ driver .launch_app ()
109
+
110
+ def quit_application (self ):
111
+ """ Quit application. Application can be quit while Appium session is kept alive.
112
+ This keyword can be used to close application during test case or between test cases.
113
+
114
+ See `Launch Application` for an explanation.
115
+
116
+ New in AppiumLibrary 1.4.6
117
+ """
118
+ driver = self ._current_application ()
119
+ driver .close_app ()
120
+
84
121
def reset_application (self ):
85
- """ Reset application """
122
+ """ Reset application. Open Application can be reset while Appium session is kept alive.
123
+ """
86
124
driver = self ._current_application ()
87
125
driver .reset ()
88
126
0 commit comments