I am a appium beginner and I am trying to start using appium to test android and ios apps. I have started with android "java" and i was wondering if anyone can help. I think it related to appium as i was unable to add package and activity as they are dropdowns and not textfileds so basically i can add package path.
This is my code:
public static void main(String[] args) throws Exception{
WebDriver driver;
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("app-package", "com.app.shopper");
caps.setCapability("browserName", "");
caps.setCapability("platformName", "Android");
caps.setCapability("app-activity", "com.app.android.ui.LaunchActivity");
caps.setCapability("takesScreenshot", true);
caps.setCapability("version", "4.4.2");
caps.setCapability("deviceName","Galaxy S4");
caps.setCapability("device ID", "6f0ab945");
caps.setCapability("app", "C:\\Program Files\\selenium\\build-tools\`9.1.0\\app.apk");
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), caps);
driver.findElement(By.linkText("Register")).click();
}
}
And this the error log:
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Command failed: Exception in thread "main" java.lang.RuntimeException: Unable to rename input apk. C:\Program Files\selenium\build-tools\19.1.0\Shopitize.apk
at s.Sign.sign(Sign.java:421)
at s.Sign.main(Sign.java:532)
) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 71.83 seconds
Build info: version: '2.46.0', revision: '87c69e2', time: '2015-06-04 16:17:10'
System info: host: 'Shopitize001', ip: '192.168.1.155', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_51'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:605)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:128)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:155)
at appium.androidTest.main(androidTest.java:36)
I will really appreciate it if anyone can help. Thanks
created
Aug '15
last reply
Dec '17
- 6
replies
- 1.8k
views
- 4
users
- 1
link