我试图使用Appium自动化我的应用程序,但我似乎无法正确配置 .
Appium Server在127.0.0.1:4723上运行并启动 . 我使用带有avd.Im的Android SDK模拟器模拟设备,使用Eclipse与Selenium和TestNG来测试我的配置 .
我得到的是@BeforeMethod中的错误
FAILED CONFIGURATION: @BeforeMethod setUp
java.lang.NoClassDefFoundError: org/openqa/selenium/logging/LoggingHandler
任何Suggstion我的配置可能有什么问题?
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 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(new
URL("http://localhost:4723/wd/hub"), capabilities);
}
@AfterMethod
public void tearDown() {
driver.quit();
}
@Test
public void sampleTest() {
}
这里还有maven依赖项,所以你知道我在哪里使用jUnit的libarys,因为我也尝试使用jUnit:
junit
junit
3.8.1
test
org.testng
testng
6.14.3
test
io.appium
java-client
6.1.0
org.seleniumhq.selenium
selenium-java
3.14.0