44import com .appium .entities .MobilePlatform ;
55import com .appium .utils .CommandPrompt ;
66import io .appium .java_client .AppiumDriver ;
7- import io .appium .java_client .MobileElement ;
87import io .appium .java_client .android .AndroidDriver ;
98import io .appium .java_client .ios .IOSDriver ;
109import io .appium .java_client .windows .WindowsDriver ;
@@ -41,7 +40,7 @@ protected static void setDriver(AppiumDriver driver) {
4140 }
4241
4342
44- private AppiumDriver < MobileElement > initialiseDriver (DesiredCapabilities desiredCapabilities )
43+ private AppiumDriver initialiseDriver (DesiredCapabilities desiredCapabilities )
4544 throws Exception {
4645 LOGGER .info ("Initialise Driver with Capabilities: " );
4746 desiredCapabilities .getCapabilityNames ().forEach (
@@ -74,7 +73,7 @@ private AppiumDriver createAppiumDriver(DesiredCapabilities desiredCapabilities,
7473 LOGGER .info ("Session Created for "
7574 + AppiumDeviceManager .getMobilePlatform ().name ()
7675 + "\n \t Session Id: " + currentDriverSession .getSessionId ()
77- + "\n \t UDID: " + currentDriverSession .getSessionDetail ("udid" ));
76+ + "\n \t UDID: " + currentDriverSession .getCapabilities (). getCapability ("udid" ));
7877 return currentDriverSession ;
7978 }
8079
@@ -87,24 +86,24 @@ private String getRemoteWDHubIP() throws Exception {
8786 }
8887
8988
90- private AppiumDriver < MobileElement > startAppiumDriverInstance (
89+ private AppiumDriver startAppiumDriverInstance (
9190 Optional <DesiredCapabilities > desiredCapabilities )
9291 throws Exception {
9392 LOGGER .info ("startAppiumDriverInstance" );
94- AppiumDriver < MobileElement > currentDriverSession =
93+ AppiumDriver currentDriverSession =
9594 initialiseDriver (desiredCapabilities .get ());
9695 AppiumDriverManager .setDriver (currentDriverSession );
9796 return currentDriverSession ;
9897 }
9998
10099 // Should be used by Cucumber as well
101- public AppiumDriver < MobileElement > startAppiumDriverInstance (String testMethodName )
100+ public AppiumDriver startAppiumDriverInstance (String testMethodName )
102101 throws Exception {
103102 return startAppiumDriverInstance (testMethodName , CAPS .get ());
104103 }
105104
106105 // Should be used by Cucumber as well
107- public AppiumDriver < MobileElement > startAppiumDriverInstance (String testMethodName ,
106+ public AppiumDriver startAppiumDriverInstance (String testMethodName ,
108107 String capabilityFilePath )
109108 throws Exception {
110109 LOGGER .info (String .format ("startAppiumDriverInstance for %s using capability file: %s" ,
@@ -145,7 +144,7 @@ public void stopAppiumDriver() throws Exception {
145144 && AppiumDriverManager .getDriver ().getSessionId () != null ) {
146145 LOGGER .info ("Session Deleting ---- "
147146 + AppiumDriverManager .getDriver ().getSessionId () + "---"
148- + AppiumDriverManager .getDriver ().getSessionDetail ("udid" ));
147+ + AppiumDriverManager .getDriver ().getCapabilities (). getCapability ("udid" ));
149148 AppiumDriverManager .getDriver ().quit ();
150149 }
151150 }
0 commit comments