Javascript 茉莉花规格超时。重置WebDriver控制流
我越来越 茉莉花规格超时。重置Javascript 茉莉花规格超时。重置WebDriver控制流,javascript,angularjs,typescript,protractor,Javascript,Angularjs,Typescript,Protractor,我越来越 茉莉花规格超时。重置WebDriver控制流 我以前也使用过fakesyn,但得到的错误消息与上面相同。 请帮帮我 这是我的规格: describe('CW Login Page', function() { var username; var password; var login; beforeEach(() => { browser.waitForAngularEnabled(false); browser.get(
WebDriver
控制流
我以前也使用过fakesyn
,但得到的错误消息与上面相同。
请帮帮我
这是我的规格:
describe('CW Login Page', function() {
var username;
var password;
var login;
beforeEach(() => {
browser.waitForAngularEnabled(false);
browser.get('http://www.testing.com/');
console.log('after link await');
});
it('should find the element and send the parameters', fakeAsync(() => {
setTimeout(function() {
value=0;
console.log('Inside it function');
username = element(by.id('userIDInput'));
password= element(by.id('passwordInput'));
login= element(by.id('login'));
console.log('After await');
username.sendKeys('abc');
password.sendKeys('abc');
login.click();
console.log("After it function");
},5000);
tick(5000);
}));
`beforeEach`(() => {
console.log('\r\n ---=== TESTS FINISHED!!! ===--- \r\n');
});
});
这是我的配置:
exports.config = {
allScriptsTimeout: 50000,
getPageTimeout:40000,
framework:'jasmine2',
/*seleniumAddress: 'http://localhost:4723/wd/hub', // Ignored if directConnect is true
specs: ['loginpage.js'],*/
seleniumAddress: 'https://hub.testingbot.com/wd/hub',
specs: ['./src/loginpage_fakeasync.e2e-specs.js'],
seleniumArgs: ['--dev-server-target'], // '--dev-server-target' ],
directConnect: false, //Change this to true for your local testing
multiCapabilities: [{ // in 1 chrome run the 10 specs sequentially
browserName: 'chrome',
platform: 'Android',
version: '7.1',
platformName: 'Android',
deviceName: 'Pixel 2',
client_key: "abc",
client_secret: "xyz"
}],
jasmineNodeOpts: {
onComplete: null, //jasmine framework details
isVerbose: false,
showColors: true,
includeStackTrace: true,
defaultTimeoutInterval: 40000,
print: function() {}
我希望打开网页并使用自动化脚本登录。如果有人能找出错误,那将是一个很大的帮助
我越来越
茉莉花规格超时。重置WebDriver
控制流
我以前也使用过fakesyn
,但得到的错误消息与上面相同。
请帮助我控制流应保持所有内容同步运行,因此不需要fakeAsync&setTimeout。如果您的框架不是太大,那么您应该考虑禁用控制流并使用<代码>异步/等待< /COD>处理承诺的样式。 我怀疑这将解决你的问题,但你可以尝试下面的代码和张贴结果
describe('CW Login Page', function () {
var username;
var password;
var login;
beforeEach(() => {
browser.waitForAngularEnabled(false);
browser.get('http://www.testing.com/');
console.log('after link await');
});
it('should find the element and send the parameters', () => {
value = 0;
console.log('Inside it function');
username = element(by.id('userIDInput'));
password = element(by.id('passwordInput'));
login = element(by.id('login'));
console.log('After await');
username.sendKeys('abc');
password.sendKeys('abc');
login.click();
console.log("After it function");
})
afterEach(() => {
console.log('\r\n ---=== TESTS FINISHED!!! ===--- \r\n');
}
});
我有一些问题,你在测试非角度应用程序吗?为什么要尝试使用
fakeAsync
?设置超时的目的只是稍微延迟规范的执行吗?是的,我正在测试非角度web应用程序。我正在使用fakeAsync,所以该命令将等待上一个命令完成。当我运行应用程序时,它没有打开网页,它会尝试2分钟,然后给出超时错误。因此我提到了设置超时。但我还是收到了同样的错误信息。请帮助我,因为我认为我缺少一些语法。您的测试套件有多大?可能值得转向异步/等待承诺处理,因为它更容易调试异步问题。感谢您的回复,在放置等待异步后,我仍然面临相同的问题:Jasmine规范超时。重置WebDriver控制流。[09:48:16]I/launcher-0个WebDriver实例仍在运行[09:48:16]I/launcher-chrome7.1#01未通过1个测试[09:48:16]I/launcher-总体:1个规范失败[09:48:16]E/launcher-进程退出,错误代码为1我的问题得到解决,我的问题是在配置文件中使用了错误的selenium地址,我的问题,谢谢你的帮助:)