AndroidUiautomator2Driver@8420 (7d63600d)] connect ECONNREFUSED 127.0.0.1:8200

Hello i’m trying to run my appium in the docker container
i’m connecting my appium to adb on local machine and it’s succesful
But when im launching tests i recive the following log

Here’s files that could help investigation of issue
version: “2.2”

services:

# Selenium hub

selenium_hub:
container_name: selenium_hub
networks:
vpcbr:
ipv4_address: 10.5.0.2
image: selenium/hub:3.14.0-curium
ports:
- “4444:4444”

appium_server:
container_name: appium_server
image: appium/appium
depends_on:
- selenium_hub
ports:
- “4725:4725”
- “4723:4723”
- “5555:5555”
privileged: true
networks:
vpcbr:
ipv4_address: 10.5.0.3
volumes:
- ~/.android:/root/.android
- /dev/bus/usb:/dev/bus/usb
environment:
- CONNECT_TO_GRID=true
- SELENIUM_HOST=selenium_hub
- RELAXED_SECURITY=true
- ANDROID_ADB_SERVER_ADDRESS=10.10.112.138
- ANDROID_ADB_SERVER_PORT=5037
command: >
sh -c “adb -a -P 5037 nodaemon server &>/dev/null & appium -pa /wd/hub --address 0.0.0.0 --port 4723”

MyAutomationContainer:
container_name: MyAutomationContainer
image: localhost:5000/MyAutomationContainer
networks:
vpcbr:
ipv4_address: 10.5.0.5
depends_on:
- selenium_hub
- appium_server
build:
context: ./
dockerfile: Dockerfile
command: >
sh -c “while sleep 3600; do :; done”

networks:
vpcbr:
driver: bridge
ipam:
config:
- subnet: 10.5.0.0/16
gateway: 10.5.0.1

```
     Conftest.py
```

import pytest
from appium import webdriver as AppiumDriver
from Pages.LogIn import LogIn

__default_docker_url = “http://10.5.0.3:4723/wd/hub”
def create_driver():
capabilities = {
“platformName”: “Android”,
“app”: “/my.apk”,
“appPackage”: “com.myapp”,
“appActivity”: “my.activity”,
“automationName”: “UiAutomator2”,
“androidInstallTimeout”: 120000
}
return AppiumDriver.Remote(__default_docker_url, desired_capabilities=capabilities)

@pytest.fixture(scope=‘function’)
def get_base_driver(request):
driver = create_driver()

```
def driver_teardown():
    driver.quit()

request.addfinalizer(driver_teardown)
return driver

```

NewLogfile.txt (105.4 KB)