Hi All ,
Getting the below error when i am running selenium based grid in appium ,
ERROR
log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Requested a new session but one was in progress) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 121 milliseconds
Build info: version: ‘2.43.1’, revision: ‘5163bceef1bc36d43f3dc0b83c88998168a363a0’, time: ‘2014-09-10 09:43:55’
System info: host: ‘LM-sjn-00877356’, ip: ‘10.244.65.221’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.10.1’, java.version: ‘1.7.0_71’
Driver info: org.openqa.selenium.remote.RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
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:599)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:153)
at com.paypal.selion.android.sample.AndroidGrid.main(AndroidGrid.java:63)
APPIUM NODE CONSOLE :
COMMAND : appium --nodeconfig /Users/mselvansr/grid/android1.json -p 4728
info: Welcome to Appium v1.3.4 (REV c8c79a85fbd6870cd6fc3d66d038a115ebe22efe)
info: Appium REST http interface listener started on 0.0.0.0:4728
info: [debug] Non-default server args: {“port”:4728,“nodeconfig”:"/Users/mselvansr/grid/android1.json"}
info: Console LogLevel: debug
info: [debug] starting auto register thread for grid. Will try to register every 5000 ms.
info: [debug] Appium successfully registered with the grid on 127.0.0.1:4433
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}
info: <-- GET /wd/hub/status 200 3.230 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}
NODE CONFIGURATION : Configured in port 4728
{
“capabilities”:
[
{
“browserName”: “Android”,
“version”:“5.0”,
“maxInstances”: 3,
“platform”:“ANDROID”,
“deviceName”:“emulator-5554”
}
],
“configuration”:{
“cleanUpCycle”:2000,
“timeout”:30000,
“proxy”:“org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,
“url”:“http://127.0.0.1:4728/wd/hub”,
“host”:“127.0.0.1”,
“port”:4728,
“maxSession”:1,
“register”:true,
“registerCycle”:5000,
“hubPort”:4433,
“hubHost”:“127.0.0.1”
}
}
SELENIUM GRID CONSOLE :
java -jar /Users/mselvansr/Downloads/selenium-server-standalone-2.44.0.jar -role hub -port 4433
22:12:46.889 INFO - Launching a selenium grid server
2015-01-25 22:12:47.514:INFO:osjs.Server:jetty-7.x.y-SNAPSHOT
2015-01-25 22:12:47.547:INFO:osjsh.ContextHandler:started o.s.j.s.ServletContextHandler{/,null}
2015-01-25 22:12:47.553:INFO:osjs.AbstractConnector:Started [email protected]:4433
Source code for running android emulator :
DesiredCapabilities capabilities = new DesiredCapabilities();
File appDir = new File("/Users/mselvansr/Developer");
File app = new File(appDir, “AndroidPdfViewer_1_0_0b.apk”);
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,“Android”);
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, “Android”);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, “emulator-5554”);
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 120);
try {
driver = new RemoteWebDriver(new URL(“http://127.0.0.1:4728/wd/hub”), capabilities);
} catch (MalformedURLException e) {
e.printStackTrace();
}
driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);
System.out.println(“App launched”);
ERROR :
log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Requested a new session but one was in progress) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 121 milliseconds
Build info: version: ‘2.43.1’, revision: ‘5163bceef1bc36d43f3dc0b83c88998168a363a0’, time: ‘2014-09-10 09:43:55’
System info: host: ‘LM-sjn-00877356’, ip: ‘10.244.65.221’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.10.1’, java.version: ‘1.7.0_71’
Driver info: org.openqa.selenium.remote.RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
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:599)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:153)
at com.paypal.selion.android.sample.AndroidGrid.main(AndroidGrid.java:63)
COMMAND FOR ADB STATUS -CONNECTED
adb devices
List of devices attached
emulator-5554 device
CLARIFICATIONS and NEED SOLUTION PLEASE :
My grid and node is started successfully and i am passing all the required DesiredCapabilities for starting android emulator then why i am getting this error and not able to start my app in emulator , HELP ME PLEASE