我无法在Selenium独立上编辑超时时间
Im not able to edit the timeout on Selenium Standalone
我正在尝试使用webdriverio, selenium standalone和Gulp创建一个测试自动化。Selenium在应用程序中运行,但我无法编辑Selenium超时默认值。页面加载得很好,但速度很慢,我得到了默认的10秒超时。如何编辑TimeOut?
下面是加载Selenium服务器的代码。 gulpfile。巴别塔import gulp from 'gulp';
import selenium from 'selenium-standalone';
import webdriver from 'gulp-webdriver';
let seleniumServer;
gulp.task('selenium:start', (done) => {
selenium.install({ logger: function(message) {} }, () => {
selenium.start((err, child) => {
if (err) { return done(err); }
seleniumServer = child;
done();
});
});
});
gulp.task('config:setup', ['selenium:start'], () => {
return gulp.src('wdio.conf.js')
.pipe(webdriver({
waitforTimeout: 60000
})).on('error', () => {
seleniumServer.kill();
process.exit(1);
});
});
gulp.task('handler', ['config:setup'], () => {
seleniumServer.kill();
});
我的测试用例
describe('Creating a new invitation request', function() {
let _page, _container;
before(() => {
_page = new page.page();
_container = new container.container();
});
it('request invitation', function() {
_page.navigate(_container.urlBase);
expect(_page.createNewRequest(_container.userToCreate));
});
});
提前感谢。
编辑,添加wdio.conf.js
exports.config = {
specs: [
'./testcases/*.js'
],
exclude: [
'./excluded/out/*.js'
],
maxInstances: 1,
capabilities:
capabilities: [{
maxInstances: 1,
browserName: 'chrome'
}],
sync: true,
logLevel: 'silent',
coloredLogs: true,
screenshotPath: './errorShots/',
baseUrl: 'http://localhost',
waitforTimeout: 90000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
framework: 'mocha',
mochaOpts: {
compilers: ['js:babel-core/register']
}
}
在wdio.conf.js
文件上,在mochaOpts
属性上添加timeout
,并在compiler
选项下添加所需的毫秒数。最后的配置是这样的:
exports.config = {
specs: [
'./testcases/*.js'
],
exclude: [
'./excluded/out/*.js'
],
maxInstances: 1,
capabilities:
capabilities: [{
maxInstances: 1,
browserName: 'chrome'
}],
sync: true,
logLevel: 'silent',
coloredLogs: true,
screenshotPath: './errorShots/',
baseUrl: 'http://localhost',
waitforTimeout: 90000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
framework: 'mocha',
mochaOpts: {
compilers: ['js:babel-core/register'],
timeout: 90000
}
}
相关文章:
- CKEditor Widget-阻止编辑可编辑元素本身
- 如何在angularJS中编辑时,如果DB中的值为true,则设置复选框,如果值为false,则取消选中复选框
- 高亮显示时编辑文本大小和颜色
- 剑道UI内联编辑:如何在点击其他按钮时隐藏按钮
- 将事件聚焦/模糊在可编辑内容的元素上
- 编辑HTML表的源数据
- ExtJS网格单元格编辑器,防止焦点松动问题
- 如何在visualstudio中调试web api时编辑javascript文件
- 具有所有样式的文本正在复制到可编辑文本区域
- 可以't使用PHP使用Froala编辑器上传图像URL
- 用Greasemonkey编辑专栏
- 如何在corona sdk中从CK编辑器中检索数据
- 使用优化器在慢速连接上加载main.js时需要js超时
- 基于数据类型的编辑框的汇总列表
- 如何使用jQuery可编辑插件检查ajax是否成功完成
- 错误:[$compile:nonassign]表达式'未定义'与指令'内容可编辑'是不可
- 如何在ng-reeat中使用ng-switch来编辑JSON API数据
- 编辑自动填充javascript的设置超时
- 我无法在Selenium独立上编辑超时时间
- 在编辑过程中取消超时