Learn2Code
Learn2Code

Reputation: 35

No route found for local appium server while automating Android app with Appium2.0

I am new to Mobile Automation. I am trying to setup Appium2.0 in my windows machine but I am running into the below issues as attached. Can someone please help?

enter image description here

enter image description here

I am trying to run the Appium server locally using the below url but always end up getting 404 error as shown in the screenshot: URL: http://192.168.0.83:4723/ or http://127.0.0.1:4723/

Upvotes: 0

Views: 799

Answers (2)

Parth Patel
Parth Patel

Reputation: 11

To launch the app in windows

   public void setUp() throws MalformedURLException {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("automationName", "Windows");
        capabilities.setCapability("platformName", "Windows");
        capabilities.setCapability("deviceName", "PCNAME");
        capabilities.setCapability("app", "path//of//your//app");
        URL appiumServerURL = new URL("http://localhost:4723");
        driver = new WindowsDriver(appiumServerURL, capabilities);
        softAssert = new SoftAssert();
    }

Upvotes: 0

Tomer Fikler
Tomer Fikler

Reputation: 166

This is not how you should use appium server. You should write a script/code file that uses appium and talks with the appium server using the URL appium is giving you.

for example, code in python to connect to android device:

from appium import webdriver
from appium.options.android.uiautomator2.base import UiAutomator2Options
    desired_capabilities = {
        'platformName': 'Android',
        'platformVersion': '11.0',  # Update this to match the Android version of your emulator
        'deviceName': 'Pixel_7_API_30',  # Update this to match the AVD name of your emulator
        'automationName': 'UiAutomator2',
        'noReset': True,
        'noSign': True,
        'avd': 'Pixel_7_API_30',
    }
options = UiAutomator2Options()
options.load_capabilities(desired_capabilities)
appium_server_url = 'http://localhost:4723'
driver = webdriver.Remote(appium_server_url, options=options)

Upvotes: 1

Related Questions