AndroidDriver, Appium, Maven, Selenium, TestNG

FAILED CONFIGURATION: @BeforeTest startDriver org.openqa.selenium.SessionNotCreatedException:

ERROR
FAILED CONFIGURATION: @BeforeTest startDriver
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: No app set; either start appium with --app or pass in an 'app' value in desired capabilities, or set androidPackage to launch pre-existing app on device) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 828 milliseconds
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40'
System info: host: 'HSNMM-KhyatiS', ip: '10.50.33.63', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_79'

Driver info: io.appium.java_client.android.AndroidDriver
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:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:180)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:158)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:109)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:39)
at mweb.TestBasic.startDriver(TestBasic.java:37)

Solution

  • Make sure JDK is well installed in your system.
  • Check testng version is compatible with the selenium version you are using.
  • Check testng version is compatible with the appium version you are using.
  • Check selenium version is compatible with the appium version you are using.
  • Try killing all the instances of the selenium webdriver object if running. Check from task manager–> processes.
  • Check the instantiation of object driver is happening once while executing a single script or a stand alone test.
  • Check you have added selenium-server-standalone-X.XX.jar not the selenium-java-X.XX.jar. Or if you are using maven/gradle or any other build tool then check you have added selenium-server-standalone-X.XX dependency in your build file.

I tried the last bullet point and it worked for me.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s