node.js - 无法在 webdriverio Cucumber 框架中为表单字段设置值
问题描述
我对 webdriver io 和 cucumber 框架非常陌生。尝试使用应用程序的登录屏幕进行我的第一次测试。我可以调用浏览器并加载网站。但是当我尝试为登录字段设置值时,它会引发以下错误并中止
“执行登录时出错:使用默认用户登录:当我使用默认用户登录时”浏览器。$(...).setValue 不是函数”
我试图安装同步包并在配置文件中将同步设置为 true。我无法让它工作。请帮忙 !
这是我的配置文件
出口.config = {
//
// ====================
// Runner Configuration
// ====================
//
// WebdriverIO allows it to run your tests in arbitrary locations (e.g. locally or
// on a remote machine).
runner: 'local',
//
path: '/wd/hub',
specs: [
'./features/*.feature'
],
// Patterns to exclude.
exclude: [
// 'path/to/excluded/files'
],
//
maxInstances: 10,
capabilities: [{
// maxInstances can get overwritten per capability. So if you have an in-house Selenium
// grid with only 5 firefox instances available you can make sure that not more than
// 5 instances get started at a time.
maxInstances: 5,
//
browserName: 'firefox',
// If outputDir is provided WebdriverIO can capture driver session logs
// it is possible to configure which logTypes to include/exclude.
// excludeDriverLogs: ['*'], // pass '*' to exclude all driver session logs
// excludeDriverLogs: ['bugreport', 'server'],
}],
logLevel: 'info',
sync:true,
bail: 0,
baseUrl: '********************',
//
// Default timeout for all waitFor* commands.
waitforTimeout: 10000,
//
// Default timeout in milliseconds for request
// if browser driver or grid doesn't send response
connectionRetryTimeout: 90000,
//
// Default request retries count
connectionRetryCount: 3,
services: ['selenium-standalone'],
framework: 'cucumber',
cucumberOpts: {
requireModule: ['@babel/register'],// <string[]> ("extension:module") require files with the given EXTENSION after requiring MODULE (repeatable)
require: ['./step-definitions/*.js'], // <string[]> (file/dir) require files before executing features
backtrace: false, // <boolean> show full backtrace for errors
dryRun: false, // <boolean> invoke formatters without executing steps
//compiler: ['js:babel-core/register'],
failFast: false, // <boolean> abort the run on first failure
format: ['pretty'], // <string[]> (type[:path]) specify the output format, optionally supply PATH to redirect formatter output (repeatable)
snippets: true, // <boolean> hide step definition snippets for pending steps
source: true, // <boolean> hide source uris
profile: [], // <string[]> (name) specify the profile to use
strict: false, // <boolean> fail if there are any undefined or pending steps
tagExpression: '', // <string> (expression) only execute the features or scenarios with tags matching the expression
timeout: 60000, // <number> timeout for step definitions
ignoreUndefinedDefinitions: false, // <boolean> Enable this config to treat undefined definitions as warnings.
},
解决方案
推荐阅读
- jquery - 初始化 Kendo Grid 分组
- c - 当端口从 0 变为 1 时,如何添加 90 分钟的延迟?
- python - 为什么输出现在在 Visual Studio 代码中显示 python 程序
- r - 如何获取满足正则表达式条件的 data.table 中的行名称?
- java - 我用IDEA把对象序列化成文件,但是不管我设置什么格式,打开的文件都是乱码
- python-3.x - 用不同的编码在 Spyder 中读取数据
- java - 如何修复 URIBuilder getRequest 参数转义
- laravel - 如果数据不存在,如何跳过关系?
- html - 我在 VBA 中开发了一个网页抓取代码,但无法导航到我需要的数据
- tensorflow - Keras:“ValueError:检查目标时出错”