1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Appium Calculator Example: No route found for //session

Discussão em 'Python' iniciado por Stack, Setembro 23, 2024.

  1. Stack

    Stack Membro Participativo

    I'm new to appium and looking to try a simple example running against the Windows calculator. I have appium2 running and installed the Windows driver. I see a number of other posts that indicate adding a "/wd/hub" but as far as I can tell that shouldn't be required for Appium 2.

    This is the error I keep getting when my python client attempts to connect:

    Appium

    [Appium] Welcome to Appium v2.11.4
    [Appium] The autodetected Appium home path: C:\Users\hugfos\.appium
    [Appium] Attempting to load driver windows...
    [Appium] Requiring driver at C:\Users\hugfos\.appium\node_modules\appium-windows-driver\build\index.js
    [Appium] WindowsDriver has been successfully loaded in 0.070s
    [Appium] Appium REST http interface listener started on http://0.0.0.0:4723
    [Appium] You can provide the following URLs in your client code to connect to this server:
    http://172.24.40.154:4723/
    http://127.0.0.1:4723/ (only accessible from the same host)
    http://172.18.144.1:4723/
    http://172.19.176.1:4723/
    [Appium] Available drivers:
    [Appium] - windows@2.12.32 (automationName 'Windows')
    [Appium] No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use.
    [HTTP] Request idempotency key: 914f40d9-a010-4b37-bdee-be38facee47b
    [HTTP] --> POST //session {"capabilities":{"firstMatch":[{}],"alwaysMatch":{"platformName":"windows","appium:eek:ptions":{"automationName":"Windows","deviceName":"WindowsPC","app":"Microsoft.WindowsCalculator_8wekyb3d8bbwe!App"}}}}
    [HTTP] No route found for //session
    [HTTP] <-- POST //session 404 7 ms - 211


    I see this error on the python side: selenium.common.exceptions.WebDriverException: Message: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource

    My Python code looks like this:

    from appium import webdriver
    from appium.options.common import AppiumOptions
    from appium.webdriver.common.appiumby import AppiumBy

    appium_server_url = "http://172.24.40.154:4723/"

    capabilities = {
    "platformName":"windows",
    "appium:eek:ptions": {
    "automationName":"Windows",
    "deviceName":"WindowsPC",
    "app":"Microsoft.WindowsCalculator_8wekyb3d8bbwe!App"
    }
    }

    options = AppiumOptions().load_capabilities(capabilities)
    driver = webdriver.Remote(appium_server_url, options=options)
    driver.find_element_by_name("One").click()
    driver.find_element_by_name("Plus").click()
    driver.find_element_by_name("Seven").click()
    driver.find_element_by_name("Equals").click()
    driver.quit()


    How can I fix the error: No route found for //session?

    Continue reading...

Compartilhe esta Página