Appium / WebDriverio存在问题,即测试不是从WebDriverio开始的
appium/webdriverio 的问题是,测试不是从webdriverio开始的,
它们会完美地运行
adb.exe
o ADB设备 o附加设备列表 o Emulator-5554设备
Appium Inspector
-
Vysor
-
Appium Server
- [appium]欢迎来到appium v1.22.3
- [appium]非默认服务器args:
- [appium]地址:127.0.0.1
-
Android Studio
我尝试过模拟和真实电话,我无法与任何手机联系,它没有与他们接触 在此页面之后,与这两个设备一起使用。 wdio config(我只取出重要项目)
exports.config = {
runner: "local",
port: 4723,
path: "/wd/hub",
specs: [
'./test/specs/**/*.js'
],
capabilities: [{
platformName: "Android",
"appium:platformVersion": "11",
"appium:deviceName": "SM-G715FN",
"appium:app": "C:\\\\Downloads\\ApiDemos-debug.apk",
"appium:appPackage": "com.wdiodemoapp",
"appium:appActivity": ".MainActivity",
"appium:automationName": "UiAutomator2"
}],
baseUrl: 'https://localhost',
framework: 'mocha',
reporters: ['spec'],
mochaOpts: {
ui: 'bdd',
require: ['@babel/register'], //////
timeout: 60000
},
services:
[
['appium',
{args:{
debugLogSpacing: true,
"base-path": "wd/hub"
},
command: 'appium',
},
],
],
package.json
{
"name": "webdriverio-tests",
"version": "0.1.0",
"private": true,
"devDependencies": {
"@babel/cli": "^7.17.10",
"@babel/core": "^7.17.12",
"@babel/preset-env": "^7.17.12",
"@babel/register": "^7.17.7",
"@wdio/appium-service": "^7.13.2",
"@wdio/cli": "^7.19.7",
"@wdio/local-runner": "^7.19.7",
"@wdio/mocha-framework": "^7.19.7",
"@wdio/spec-reporter": "^7.19.7",
"appium-uiautomator2-driver": "^2.1.2",
"appium-xcuitest-driver": "^4.4.2",
"eslint": "^8.15.0",
"eslint-plugin-wdio": "^7.19.4",
"ts-node": "^10.7.0",
"typescript": "^4.6.4"
},
"scripts": {
"wdio": "wdio run wdio.conf.js"
},
"dependencies": {
"@wdio/sync": "^7.19.7",
"appium": "^2.0.0-beta.35",
"wdio-image-comparison-service": "^3.1.1"
},
"description": "Appium tests using WebdriverIO",
"main": "wdio.conf.js",
"keywords": [
"webdriverio",
"appium"
],
"author": "",
"license": "ISC"
}
Test
describe('Sample', () => {
it('Connect', async () => {
const field = await client.$("android.widget.EditText");
await field.setValue("Hi Sir!");
await client.deleteSession();
});
测试失败: 由于请求的资源无法找到状态404的请求失败,或者使用映射资源不支持的HTTP方法收到请求 [post] http:// localhost:4723/session
我检查了此“ https://stackoverflow.com/questions/44828114/44828114/appium-webveriverio-setup" ,,但无济于事。在此处输入代码
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试使用此行
而不是
Try using this line
instead of
package.json
这是我的黄瓜项目配置。我正在运行模拟器和真实的设备都可以正常工作,我也在运行iOS模拟器,这也很好。如果您想检查cumcumber设置,我可以帮忙。
您需要安装Android Studio和设置环境变量,以便您的系统可以运行ADB命令。
您还需要在系统中设置Java_home环境变量。
对于iOS,您需要安装XCode。
package.json
These are my cucumber project configuration . i am running my emulator and real device both working , i am also running IOS simulator thats also working good . if u wanna check cumcumber settings i can help.
you need android studio installed and environment variables set so your system can run adb commands.
you also need to set JAVA_HOME environment variables in your system .
for IOS you need xcode installed .
如果您在服务上使用Appium Global,请尝试使用。就我而言,此配置仅适用于
127.0.0.1
,而不是localhost
:If you are using appium global on service try this. In my case, this configuration only worked with
127.0.0.1
, notlocalhost
: