gpt4 book ai didi

java - 启动appium浏览器时出错:- org. openqa.selenium.WebDriverException : ERROR running Appium command: Arguments to path.解析必须是字符串

转载 作者:行者123 更新时间:2023-12-01 09:34:49 25 4
gpt4 key购买 nike

无法在真实设备上启动 Chrome 浏览器,发现错误:

-ERROR running Appium command: Arguments to path.resolve must be strings

please help

Launching Appium server with command: C:\Program Files\Appium\node.exe lib\server\main.js --address 127.0.0.1 --port 4723 --chromedriver-port 8080 --platform-name Android --platform-version 19 --automation-name Appium --log-no-color info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d) info: Appium REST http interface listener started on 127.0.0.1:4723 info: [debug] Non-default server args: {"address":"127.0.0.1","logNoColors":true,"platformName":"Android","platformVersion":"19","automationName":"Appium","chromeDriverPort":8080} info: Console LogLevel: debug info: --> POST /wd/hub/session {"desiredCapabilities":{"appPackage":"com.android.chrome","browserName":"Chrome","platformName":"Android","deviceName":"Android","platformVersion":"4.4.2"}} info: Client User-Agent string: Apache-HttpClient/4.5.1 (Java/1.8.0_91) info: Set mode: Proxying straight through to Chromedriver info: [debug] Looks like we want chrome on android info: <-- POST /wd/hub/session 500 11.995 ms - 95 TypeError: Arguments to path.resolve must be strings at Object.win32.resolve (path.js:146:13) at [object Object].Device.configure (C:\Program Files\Appium\node_modules\appium\lib\devices\device.js:41:31) at [object Object].ChromeAndroid.configure (C:\Program Files\Appium\node_modules\appium\lib\devices\android\chrome.js:51:8) at [object Object].Appium.configure (C:\Program Files\Appium\node_modules\appium\lib\appium.js:250:15) at [object Object]. (C:\Program Files\Appium\node_modules\appium\lib\appium.js:118:10) at [object Object].Appium.start (C:\Program Files\Appium\node_modules\appium\lib\appium.js:129:5) at exports.createSession (C:\Program Files\Appium\node_modules\appium\lib\server\controller.js:188:16) at Layer.handle [as handle_request] (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:110:13) at Route.dispatch (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:91:3) at Layer.handle [as handle_request] (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5) at C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\index.js:267:22 at Function.proto.process_params (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:100:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at C:\Program Files\Appium\node_modules\appium\lib\server\controller.js:39:7 at Layer.handle [as handle_request] (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:110:13) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14) at Route.dispatch (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:91:3) at Layer.handle [as handle_request] (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5) at C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\index.js:267:22 at Function.proto.process_params (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10) at methodOverride (C:\Program Files\Appium\node_modules\appium\node_modules\method-override\index.js:79:5) at Layer.handle [as handle_request] (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5) at trim_prefix (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\index.js:302:13) at C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\index.js:270:7 at Function.proto.process_params (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10) at logger (C:\Program Files\Appium\node_modules\appium\node_modules\morgan\index.js:136:5) at Layer.handle [as handle_request] (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5) at trim_prefix (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\index.js:302:13) at C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\index.js:270:7 at Function.proto.process_params (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12) at next (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10) at C:\Program Files\Appium\node_modules\appium\node_modules\body-parser\lib\read.js:111:5 at done (C:\Program Files\Appium\node_modules\appium\node_modules\body-parser\node_modules\raw-body\index.js:248:14) at IncomingMessage.onEnd (C:\Program Files\Appium\node_modules\appium\node_modules\body-parser\node_modules\raw-body\index.js:294:7) at IncomingMessage.g (events.js:199:16)

最佳答案

引用以下代码解决您的问题

AppiumDriver driver;
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "Android");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability(CapabilityType.BROWSER_NAME, "Chrome");
capabilities.setCapability("platformVersion", "5.0.2");
capabilities.setCapability("appPackage", "com.android.chrome");
capabilities.setCapability("appActivity","com.google.android.apps.chrome.ChromeTabbedActivity");
driver= new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.get("http://google.com");

关于java - 启动appium浏览器时出错:- org. openqa.selenium.WebDriverException : ERROR running Appium command: Arguments to path.解析必须是字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39092845/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com