I have chrome installed on my android device and adb connected with the device.
then I try to run below testing code on Linux.
const driver = require("webdriverio");
const webopts = {
path: '/wd/hub',
port: 4723,
capabilities: {
'platformName': "android",
'appium:platformVersion': "9",
'appium:browerName': "chrome",
'appium:showChromedriverLog': true,
'appium:automationName': "UiAutomator2"
}
};
async function web() {
const client = await driver.remote(webopts);
await client.url("https://appium.io/");
const title = await client.getTitle();
await client.deleteSession();
}
web();
and got error below.
[HTTP] --> POST /wd/hub/session/7664d298-2fa4-4242-acb2-93ec1d8cb4fd/url
[HTTP] {"url":"https://appium.io/"}
[debug] [W3C (7664d298)] Calling AppiumDriver.setUrl() with args: ["https://appium.io/","7664d298-2fa4-4242-acb2-93ec1d8cb4fd"]
[debug] [W3C (7664d298)] Encountered internal error running command: Error: URI and package arguments are required
[debug] [W3C (7664d298)] at ADB.startUri (/home/pan/node_modules/appium/node_modules/appium-adb/lib/tools/apk-utils.js:72:11)
[debug] [W3C (7664d298)] at AndroidUiautomator2Driver.commands.setUrl (/home/pan/node_modules/appium/node_modules/appium-uiautomator2-driver/lib/commands/general.js:202:18)
[debug] [W3C (7664d298)] at commandExecutor (/home/pan/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/driver.js:335:9)
[debug] [W3C (7664d298)] at /home/pan/node_modules/appium/node_modules/async-lock/lib/index.js:146:12
[debug] [W3C (7664d298)] at AsyncLock._promiseTry (/home/pan/node_modules/appium/node_modules/async-lock/lib/index.js:280:31)
[debug] [W3C (7664d298)] at exec (/home/pan/node_modules/appium/node_modules/async-lock/lib/index.js:145:9)
[debug] [W3C (7664d298)] at AsyncLock.acquire (/home/pan/node_modules/appium/node_modules/async-lock/lib/index.js:162:3)
[debug] [W3C (7664d298)] at AndroidUiautomator2Driver.executeCommand (/home/pan/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/driver.js:348:39)
[debug] [W3C (7664d298)] at AppiumDriver.executeCommand (/home/pan/node_modules/appium/lib/appium.js:563:36)
[debug] [W3C (7664d298)] at processTicksAndRejections (node:internal/process/task_queues:96:5)
[debug] [W3C (7664d298)] at asyncHandler (/home/pan/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:297:21)
[HTTP] <-- POST /wd/hub/session/7664d298-2fa4-4242-acb2-93ec1d8cb4fd/url 500 8 ms - 563
[HTTP]
[debug] [Instrumentation] The process has exited with code 0
[debug] [Instrumentation] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:
[Logcat] Logcat terminated with code 0, signal null
It seems it is calling the deep link function but I expect it calls the chrome to navigate to a url on Andriod. Iâm using Appium v1.22.3
. Any idea what was wrong?