@@ -93,6 +93,7 @@ private void startReportLogging(ITestResult iTestResult) throws IOException,
9393 */
9494 @ Override
9595 public void beforeInvocation (IInvokedMethod iInvokedMethod , ITestResult iTestResult ) {
96+ System .out .println ("inside ATD:beforeInvocation" );
9697 String testMethodName = iInvokedMethod .getTestMethod ().getMethodName ();
9798 allocateDeviceAndStartDriver (testMethodName , iTestResult );
9899 if (!isCloudExecution ()) {
@@ -121,6 +122,7 @@ public void beforeInvocation(IInvokedMethod iInvokedMethod, ITestResult iTestRes
121122
122123 private void allocateDeviceAndStartDriver (String testMethodName , ITestResult iTestResult ) {
123124 try {
125+ System .out .println ("inside start of ATD:allocateDeviceAndStartDriver" );
124126 AppiumDriver driver = AppiumDriverManager .getDriver ();
125127 if (driver == null || driver .getSessionId () == null ) {
126128 deviceAllocationManager .allocateDevice (deviceAllocationManager
@@ -133,6 +135,8 @@ private void allocateDeviceAndStartDriver(String testMethodName, ITestResult iTe
133135 } catch (Exception e ) {
134136 e .printStackTrace ();
135137 }
138+ System .out .println ("inside end of ATD:allocateDeviceAndStartDriver" );
139+
136140 }
137141
138142 /*
@@ -158,8 +162,10 @@ public void afterInvocation(IInvokedMethod iInvokedMethod, ITestResult iTestResu
158162 }
159163 }
160164 if (iInvokedMethod .isTestMethod ()) {
161- AppiumDriverManager . getDriver (). quit ( );
165+ System . out . println ( "Releasing the Device" );
162166 deviceAllocationManager .freeDevice ();
167+ AppiumDriverManager .getDriver ().quit ();
168+ System .out .println ("Releasing the Device Done" );
163169 if (!isCloudExecution ()) {
164170 appiumDriverManager .stopAppiumDriver ();
165171 }
0 commit comments