Mobile Device Cloud AI4Test Quality & Intelligent Automation Unsere Expertise Blog Kategorien Mobile Device Cloud Testen mit künstlicher Intelligenz Quality & Intelligent Automation Support Erste Schritte EN DE EN DE Leistungen Mobile Device Cloud Funktionen im Überblick Tarife im Vergleich Zielgruppe Automatisierung & Frameworks Vorteile Geräte in der MDC Erste Schritte mit der MDC Preise & Bestellen AI4Test Überblick Details Funktionsweise & Vorgehen Einsatzmöglichkeiten Vorteile Preise & Anfragen Quality & Intelligent Automation Prozesse Effizienz Lösungen Vorteile Expertise Anfragen Unsere Expertise Best Practice Experten Partner Blog Blog Kategorien Release Notes Appium Automatisierung Webportal Preise & Bestellung Mobile Device Cloud Testen mit künstlicher Intelligenz Quality & Intelligent Automation Hilfe Support Kontakt Häufig gestellte Fragen Erste Schritte Registrierung und Bestellung Nutzung der Mobile Device Cloud

Testautomatisierung auf realen mobilen Geräten

Testautomatisierer Tester Entwickler Designer & UX-Experten

Die Mobile Device Cloud richtet sich mit ihren Funktionen des Mobile Device Testing u. A. an Testautomatisierer von mobilen Apps für iOS und Android und Webanwendungen.

Mit folgenden Funktionen unterstützt die Mobile Device Cloud den erfolgreichen Testautomatisierungsprozess:

Unterstützung von Frameworks zur Automatisierung Appium, Espresso, XCUITest, Selenium. Automatisierung von nativen Apps und Webanwendungen. Automatisierung mittels Java, Python, Ruby, JavaScript. Integration in der CI/CD Pipeline unter Verwendung von Gradle oder Maven. Bereitstellung von Reports der Testausführungen. Developer Modus (Analyse der App- und Webseitenstruktur).
<
>
Automatisierte Testausführung(Video-) Reports der TestausführungDeveloper Modus | Mobile Device Cloud
import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.ios.IOSElement;
import io.appium.java_client.remote.MobileBrowserType;
import org.openqa.selenium.By;
import org.openqa.selenium.ScreenOrientation;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;

public class LocalMobileTest {
    private String accessKey = "ACCESS_KEY";
    WebDriverWait webDriverWait = null;
    protected IOSDriver<IOSElement> driver = null;
    DesiredCapabilities dc = new DesiredCapabilities();

    @BeforeTest
    public void setUp() throws MalformedURLException {
        dc.setCapability("accessKey", accessKey);
        dc.setCapability("testName", "Quick Start iOS Browser Demo");
        dc.setCapability("deviceQuery", "@os='ios' and @category='PHONE'");
        dc.setBrowserName(MobileBrowserType.SAFARI);
        driver = new IOSDriver<>(new URL("https://mobiledevicecloud.t-systems-mms.eu/wd/hub"), dc);
        webDriverWait = new WebDriverWait(driver, 5);
    }

    @Test
    public void quickStartiOSBrowserDemo() {
        driver.rotate(ScreenOrientation.PORTRAIT);

        driver.get("https://mobiledevice.cloud/");

        waitUntilElementLoaded("//*[@id='no_consent']").click();
        waitUntilElementLoaded("//*[@class='navbar-toggler-icon']").click();

        waitUntilElementLoaded("//*[@id='blog']").click();
        waitUntilElementLoaded("//*[@id='article1']").click();

        WebElement author = waitUntilElementLoaded("//*[@class='author']");

        Assert.assertTrue(author.isDisplayed());

        waitUntilElementLoaded("//*[@class='navbar-toggler-icon']").click();
        waitUntilElementLoaded("//*[@id='link_faq']").click();

        List<WebElement> faq_blocks = waitUntilElementsLoaded("//*[@class='faq_block']");
        WebElement faqSearch = waitUntilElementLoaded("//*[@id='faq-search']");

        Assert.assertTrue(faqSearch.isDisplayed());
        Assert.assertTrue(
            faq_blocks.size() > 0,
            "Expected at least one faq_block element, but there are no elements with that name");
        Assert.assertEquals(
            faq_blocks.size(),
            12,
            "Expected twelve faq_block elements, but there are " + faq_blocks.size() + " elements");

        faqSearch.sendKeys("automatisierte");

        List<WebElement> found_faqs = waitUntilElementsLoaded("//*[@class='faq_block search-hit']");

        Assert.assertTrue(
            found_faqs.size() > 0,
            "Expected at least one faq_block element, but there are no elements with that name");
        Assert.assertEquals(
            found_faqs.size(),
            5,
            "Expected five faq_block elements, but there are " + found_faqs.size() + " elements");
    }

    @AfterTest
    public void tearDown() {
        System.out.println("Report URL: "+ driver.getCapabilities().getCapability("reportUrl"));
        driver.quit();
    }

    private WebElement waitUntilElementLoaded(String xpath) {
        return webDriverWait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(xpath)));
    }

    private List<WebElement> waitUntilElementsLoaded(String xpath) {
        return webDriverWait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.xpath(xpath)));
    }
}

Haben Sie noch Fragen?

Jetzt Kontakt aufnehmen Kostenlos starten