appium ios - FAILED: invokeApp org.openqa.selenium.SessionNotCreatedException: A new session could not be created -
import java.io.file; import java.net.malformedurlexception; import java.net.url; import org.openqa.selenium.remote.desiredcapabilities; import org.testng.annotations.test; import io.appium.java_client.android.androiddriver; public class demo { androiddriver driver =null; desiredcapabilities capabilities; file app = new file("/data/app/com.philips.sleepmapper.root-1/base.apk"); @test public void invokeapp() throws malformedurlexception { capabilities = new desiredcapabilities(); capabilities.setcapability("automationname", "appium"); capabilities.setcapability("paltformname", "android"); capabilities.setcapability("platformversion", "6.0.1"); capabilities.setcapability("devicenmae", "galaxy s6"); capabilities.setcapability("app", app.getabsolutepath()); capabilities.setcapability("apppackage","com.philips.sleepmapper.root"); capabilities.setcapability("appactivity","com.philips.sleepmapper.activity.splashscreenactivity"); driver = new androiddriver(new url("http://127.0.0.1:4723/wd/hub"), capabilities); }
}
when executing code getting following error:
failed: invokeapp org.openqa.selenium.sessionnotcreatedexception: new session not created. (original error: bad app: c:\data\app\com.philips.sleepmapper.root-1\base.apk. app paths need absolute, or relative appium server.
the path application apk set incorrectly. need know file structure give exact answer, think wrong.
most trying provide application @ c:\path\to\my\project\data\app\com.philips.sleepmapper.root-1\base.apk
if run appium in c:\path\to\my\project
, try pass relative path apk, missing dot in appium test code. change path in code to
file app = new file("./data/app/com.philips.sleepmapper.root-1/base.apk");
to make work folder (absolute path) change code to
file app = new file("c:\path\to\my\project\data\app\com.philips.sleepmapper.root-1\base.apk");
remember replace path\to\my\project
real path using.
Comments
Post a Comment