88import io .appium .java_client .AppiumDriver ;
99import io .appium .java_client .MobileElement ;
1010import io .appium .java_client .ios .IOSDriver ;
11+ import io .appium .java_client .ios .IOSElement ;
1112
1213import java .io .File ;
1314import java .net .URL ;
4647@ SuppressWarnings ("deprecation" )
4748public class UICatalogTest {
4849
49- private AppiumDriver <MobileElement > driver ;
50+ private AppiumDriver <IOSElement > driver ;
5051
5152 private WebElement row ;
5253
@@ -60,7 +61,7 @@ public void setUp() throws Exception {
6061 capabilities .setCapability ("platformVersion" , "8.1" );
6162 capabilities .setCapability ("deviceName" , "iPhone 6" );
6263 capabilities .setCapability ("app" , app .getAbsolutePath ());
63- driver = new IOSDriver <MobileElement >(new URL ("http://127.0.0.1:4723/wd/hub" ), capabilities );
64+ driver = new IOSDriver <>(new URL ("http://127.0.0.1:4723/wd/hub" ), capabilities );
6465 }
6566
6667 @ After
@@ -85,7 +86,7 @@ private Point getCenter(WebElement element) {
8586 @ Test
8687 public void testFindElement () throws Exception {
8788 //first view in UICatalog is a table
88- MobileElement table = ( MobileElement ) driver .findElementByClassName ("UIATableView" );
89+ IOSElement table = driver .findElementByClassName ("UIATableView" );
8990 assertNotNull (table );
9091 //is number of cells/rows inside table correct
9192 List <MobileElement > rows = table .findElementsByClassName ("UIATableCell" );
@@ -156,7 +157,7 @@ public void testAlertInteraction() {
156157 openMenuPosition (10 );
157158
158159 //trigger modal alert with cancel & ok buttons
159- List <MobileElement > triggerOkCancel = driver .findElementsByAccessibilityId ("Show OK-Cancel" );
160+ List <IOSElement > triggerOkCancel = driver .findElementsByAccessibilityId ("Show OK-Cancel" );
160161 triggerOkCancel .get (1 ).click ();
161162 Alert alert = driver .switchTo ().alert ();
162163 //check if title of alert is correct
0 commit comments