Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running simple example to test appium docker #68

Closed
Moshik177 opened this issue Dec 21, 2017 · 3 comments
Closed

running simple example to test appium docker #68

Moshik177 opened this issue Dec 21, 2017 · 3 comments

Comments

@Moshik177
Copy link

Hi ,
i am pretty new with dockers but working with appium a long time, what i am trying to do is to run appium through docker with usb , i install what i needed with your code (create a hub on selenium grid and node with node js , in ports 4444 and 4723 as usual) , i create java project that contain the creation of the instance , here is a snippet of the code :

public static void main(String[] args) throws MalformedURLException {

    DesiredCapabilities capabilities = new DesiredCapabilities();

    capabilities.setCapability("deviceName","Android");
    capabilities.setCapability("app","app-debug.apk");
    capabilities.setCapability("platformName","Android");
    capabilities.setCapability("platformVersion","5.0");
    capabilities.setCapability("appWaitPackage","com.***.****");   
    capabilities.setCapability("appWaitActivity","com.***.***.***.****");

    AndroidDriver driver = new AndroidDriver<MobileElement>(new 
                                                                    URL("http://127.17.0.3:4723/wd/hub"),capabilities);
}

i create a new docker that run the java jar that created after compile the project

FROM java:8
EXPOSE 8080
ADD /target/test-1.0-SNAPSHOT.jar test-1.0-SNAPSHOT.jar
ADD /target/lib/ /lib/
ADD app-debug.apk app-debug.apk
ENTRYPOINT ["java","-jar","test-1.0-SNAPSHOT.jar"]

when i running the code with expose to the port 8080 , i get connect refuse .. can you advise ?

Exception in thread "main" org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException: Connect to 127.17.0.3:4723 [/127.17.0.3] failed: Connection refused: connect
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info host: '4bb330d0f54c' , ip: '172.17.0.3 , os.name: 'Linux' , os.arch: 'amd64' , os.version: '4.4.104-boot2docker' , java.version: '1.8.0._111'
Driver info: driver.version: AndroidDriver
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:177)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
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:250)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:137)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:88)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:112)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:73)
at main.main(main.java:26)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to 127.17.0.3:4723 [/127.17.0.3] failed: Connection refused: connect
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:159)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:139)
at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:87)
at io.appium.java_client.remote.AppiumProtocolHandShake.createSession(AppiumProtocolHandShake.java:114)
at io.appium.java_client.remote.AppiumProtocolHandShake.createSession(AppiumProtocolHandShake.java:76)
at io.appium.java_client.remote.AppiumCommandExecutor.doExecute(AppiumCommandExecutor.java:111)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:162)
... 17 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
... 32 more

@budtmo
Copy link
Member

budtmo commented Apr 29, 2018

Hi @Moshik177 ,

do you still have this issue? is it about docker-appium or your dockerized test? and is it because the port 8080 is already used by other tool or something?

@budtmo
Copy link
Member

budtmo commented May 8, 2018

I will close this issue because there is no response. Please feel free to reopen it.

@budtmo budtmo closed this as completed May 8, 2018
@madanreddy123
Copy link

how to install the drivers and plugins of appium on the container

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants