lundi 1 octobre 2018

Appium Configuration Java

Im trying to automize my App using Appium, but I can't seem to get the configuration right.

Appium Server is running on 127.0.0.1:4723 and started. I emulate a Device using the Android SDK emulator with avd.Im using Eclipse with Selenium and TestNG to test my configuration.

What I get is an Error in the @BeforeMethod

FAILED CONFIGURATION: @BeforeMethod setUp
java.lang.NoClassDefFoundError: org/openqa/selenium/logging/LoggingHandler

Any Suggstion what might be wrong in my configuration?

package xxx_appium.xxx_appium_test;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import org.aspectj.lang.annotation.Before;
import org.openqa.selenium.By;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.Point;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.service.DriverCommandExecutor;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import bsh.Capabilities;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;

public class ConnectionTest {

@BeforeMethod
public void setUp() throws MalformedURLException {

    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("BROWSER_NAME", "Android");
    capabilities.setCapability("avd","ANexus");
    capabilities.setCapability("deviceName", "ANexus");
    capabilities.setCapability("platformName", "Android");
    capabilities.setCapability("platformVersion", "9");
    capabilities.setCapability("app", 
    "C:\\Users\\xxx\\Downloads\\yyyy.apk");

    driver = new AndroidDriver<WebElement>(new         
    URL("http://localhost:4723/wd/hub"), capabilities);

}
@AfterMethod
public void tearDown() {
    driver.quit();
}

@Test
public void sampleTest() {
}

Aucun commentaire:

Enregistrer un commentaire