When trying to invoke android driver using java with below mentioned statement
andriodDriver = new AndroidDriver<WebElement>(hubURL, capabilities);
Below mentioned exception is displayed, org.openqa.selenium.WebDriverException: Connection refused: connect Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:42:44.417Z' System info: host: 'INBONAMP', ip: '10.240.97.163', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_161' Driver info: driver.version: AndroidDriver
Capabilities Defined :
app=C:\Automation\gsm2.apk,
appactivity=.GSM2Activity,
newCommandTimeout=0,
apppackage=com.eyc.gsm2,
locationContextEnabled=true,
automationName=UiAutomator2,
autoWebView=true,
androidDeviceSocket=com.eyc.gsm2_devtools_remote,
platformName=Android,
deviceName=SANDU4S8SBUQKQGKRWC
When I have started Appium manually its working fine and I am able execute tests on the appium server.