Am getting the following errors. Please help. Am not able to proceed.
Please find here the appium server logs:
Microsoft Windows [Version 10.0.10586]
© 2015 Microsoft Corporation. All rights reserved.
C:\Users\ACER>appium
[Appium] Welcome to Appium v1.10.0
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session
[HTTP] {“desiredCapabilities”:{“app”:“C:\Users\ACER\eclipse-workspace\Basics\src\ApiDemos-debug.apk”,“platformName”:“Android”,“deviceName”:“Gowri”},“capabilities”:{“alwaysMatch”:{“appium:app”:“C:\Users\ACER\eclipse-workspace\Basics\src\ApiDemos-debug.apk”,“appium:deviceName”:“Gowri”,“platformName”:“android”},“firstMatch”:[{}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{“app”:“C:\Users\ACER\eclipse-workspace\Basics\src\ApiDemos-debug.apk”,“platformName”:“Android”,“deviceName”:“Gowri”},null,{“alwaysMatch”:{“appium:app”:“C:\Users\ACER\eclipse-workspace\Basics\src\ApiDemos-debug.apk”,“appium:deviceName”:“Gowri”,“platformName”:“android”},“firstMatch”:[{}]}]
[debug] [BaseDriver] Event ‘newSessionRequested’ logged at 1547862399806 (07:16:39 GMT+0530 (India Standard Time))
[Appium] Creating new AndroidDriver (v4.8.0) session
[Appium] Capabilities:
[Appium] platformName: android
[Appium] app: C:\Users\ACER\eclipse-workspace\Basics\src\ApiDemos-debug.apk
[Appium] deviceName: Gowri
[debug] [BaseDriver] W3C capabilities {“alwaysMatch”:{"platformNa… and MJSONWP desired capabilities {“app”:"C:\Users\ACER\ec… were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {“alwaysMatch”:{"platformNa…
[BaseDriver] Session created with session id: cd330760-e9d8-4eac-9987-4b16259813c7
(node:7284) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[debug] [AndroidDriver] Shutting down Android driver
[debug] [AndroidDriver] Called deleteSession but bootstrap wasn’t active
[debug] [BaseDriver] Event ‘newSessionStarted’ logged at 1547862400451 (07:16:40 GMT+0530 (India Standard Time))
[debug] [W3C] Encountered internal error running command: Error: Command ‘java -version’ exited with code 2
[debug] [W3C] at ChildProcess.proc.on.code (C:\Users\ACER\AppData\Roaming\npm\node_modules\appium\node_modules\teen_process\lib\exec.js:94:19)
[debug] [W3C] at ChildProcess.emit (events.js:182:13)
[debug] [W3C] at maybeClose (internal/child_process.js:962:16)
[debug] [W3C] at Socket.stream.socket.on (internal/child_process.js:381:11)
[debug] [W3C] at Socket.emit (events.js:182:13)
[debug] [W3C] at Pipe._handle.close (net.js:610:12)
[HTTP] <-- POST /wd/hub/session 500 824 ms - 643
Please find here the eclipse console error:
Exception in thread “main” org.openqa.selenium.WebDriverException: It is impossible to create a new session because ‘createSession’ which takes HttpClient, InputStream and long was not found or it is not accessible
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: '2018-11-14T08:25:48’
System info: host: ‘DESKTOP-8S20KRB’, ip: ‘192.168.43.73’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: '1.8.0_191’
Driver info: driver.version: AndroidDriver
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:195)
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:209)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:231)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:84)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:94)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:93)
at Basic.main(Basic.java:24)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:185)
… 13 more
Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Command ‘java -version’ exited with code 2
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: '2018-11-14T08:25:48’
System info: host: ‘DESKTOP-8S20KRB’, ip: ‘192.168.43.73’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: '1.8.0_191’
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Command ‘java -version’ exited with code 2
at getResponseForW3CError (C:\Users\ACER\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:826:9)
at asyncHandler (C:\Users\ACER\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:447:37)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62)
at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
… 18 more
Program:
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.remote.MobileCapabilityType;
public class Basic {
public static void main(String[] args) throws MalformedURLException {
// TODO Auto-generated method stub
File appdir = new File(“src”);
File app = new File(appdir,“ApiDemos-debug.apk”);
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, “Gowri”);
capabilities.setCapability(MobileCapabilityType.APP,app.getAbsolutePath());
AndroidDriver driver = new AndroidDriver<>(new URL(“http://127.0.0.1:4723/wd/hub”),capabilities);
}
}