The URL '/session' did not map to a valid resource | How to run desktop application test using winAppDriver / windows application driver using java? The URL '/session' did not map to a valid resource | How to run desktop application test using winAppDriver / windows application driver using java? windows windows

The URL '/session' did not map to a valid resource | How to run desktop application test using winAppDriver / windows application driver using java?


After long research, I have found the answer for the above question. We can solve this using two methods.

NOTE: You should start either appium server or winappdriver.exe. Don't try to run both appium and winappdriver at once by your self.

  1. If you are starting appium server, you should give the URI as well as below following by the IP and port;

    CalculatorSession = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);

  2. If you are running the winappdriver.exe directly, you should give only the IP and the port of winappdriver as below;

    CalculatorSession = new IOSDriver(new URL("http://127.0.0.1:4723"), capabilities);


Thanks @Vijendran Selvarajah at first.

for this example:http://appium.io/docs/en/about-appium/getting-started/need add this line path: "/wd/hub"

// javascriptconst wdio = require("webdriverio");const assert = require("assert");const opts = {  port: 4723,  path: "/wd/hub", // fix: The URL '/session' did not map to a valid resource  capabilities: {    platformName: "Android",    platformVersion: "8",    deviceName: "Android Emulator",    app: "/path/to/the/downloaded/ApiDemos.apk",    appPackage: "io.appium.android.apis",    appActivity: ".view.TextFields",    automationName: "UiAutomator2"  }};async function main () {  const client = await wdio.remote(opts);  const field = await client.$("android.widget.EditText");  await field.setValue("Hello World!");  const value = await field.getText();  assert.equal(value,"Hello World!");  await client.deleteSession();}main();

I will share a completed doc and zip in the feature about how to use Appium to test Android App with all deps.


to my testing, the calculator app in windows doesn't open when you giving the system path you have to useMicrosoft.WindowsCalculator_8wekyb3d8bbwe!App

and you don't need to open appium sever has appium has the older version of winappdriver(0.7)

and just saying the winappdriver server should be running in the background