Using Appium Inspector with Sauce Labs

WordPress deleted this post, I’ll work on restoring it

 

New Appium Session.pngAppium Sauce Labs Session.png


<XCUIElementTypeApplication name="TestApp">
<XCUIElementTypeOther>
<XCUIElementTypeWindow>
<XCUIElementTypeOther>
<XCUIElementTypeTextField name="IntegerA">
<XCUIElementTypeTextField name="IntegerB">
<XCUIElementTypeButton name="ComputeSumButton">
<XCUIElementTypeStaticText name="Answer">
<XCUIElementTypeButton name="show alert">
<XCUIElementTypeButton name="contact alert">
<XCUIElementTypeButton name="location alert">
<XCUIElementTypeStaticText name="AppElem">
<XCUIElementTypeSlider name="AppElem">
<XCUIElementTypeStaticText name="AppElem">
<XCUIElementTypeButton name="DisabledButton">
<XCUIElementTypeStaticText>
<XCUIElementTypeSwitch name="locationStatus">
<XCUIElementTypeButton name="Test Gesture">
<XCUIElementTypeButton name="Crash">
<XCUIElementTypeStaticText name="Access'ibility">
<XCUIElementTypeButton name="Check calendar authorized">
<XCUIElementTypeWindow>
<XCUIElementTypeWindow>
<XCUIElementTypeWindow>

view raw

AppSource.xml

hosted with ❤ by GitHub


import io.appium.java_client.MobileElement;
import io.appium.java_client.ios.IOSDriver;
import junit.framework.TestCase;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.DesiredCapabilities;
public class SampleTest {
private IOSDriver driver;
@Before
public void setUp() throws MalformedURLException {
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("platformName", "iOS");
desiredCapabilities.setCapability("platformVersion", "10.2");
desiredCapabilities.setCapability("deviceName", "iPhone Simulator");
desiredCapabilities.setCapability("deviceOrientation", "portrait");
desiredCapabilities.setCapability("app", "sauce-storage:TestApp-iOS-10.2.zip");
URL remoteUrl = new URL("http://ondemand.saucelabs.com:80/wd/hub&quot;);
driver = new IOSDriver(remoteUrl, desiredCapabilities);
}
@Test
public void sampleTest() {
MobileElement el1 = (MobileElement) driver.findElementByAccessibilityId("IntegerA");
el1.sendKeys("1");
MobileElement el2 = (MobileElement) driver.findElementByAccessibilityId("IntegerB");
el2.sendKeys("2");
MobileElement el3 = (MobileElement) driver.findElementByAccessibilityId("ComputeSumButton");
el3.click();
List<MobileElement> els1 = (MobileElement) driver.findElementsById("Answer");
}
@After
public void tearDown() {
driver.quit();
}
}

view raw

SampleTest.java

hosted with ❤ by GitHub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s