简体   繁体   English

僵尸获取错误未处理的拒绝错误:超时:未能加载此页面上的所有资源

[英]Zombie getting error Unhandled rejection Error: Timeout: did not get to load all resources on this page

I am new to zombie JS. 我是僵尸JS的新手。 I want to fill the login fields and post the login form. 我想填写登录字段并发布登录表单。 I tried to code this in zombiejs, but getting below error. 我试图用zombiejs编写此代码,但出现错误。

Unhandled rejection Error: Timeout: did not get to load all resources on this page at timeout (C:\\Users\\sapna.maid\\Desktop\\nodejs\\index\\node_modules\\zombie\\lib \\eventloop.js:601:38) at Timer.listOnTimeout (timers.js:92:15) 未处理的拒绝错误:超时:超时时未加载此页面上的所有资源(C:\\ Users \\ sapna.maid \\ Desktop \\ nodejs \\ index \\ node_modules \\ zombie \\ lib \\ eventloop.js:601:38) .listOnTimeout(timers.js:92:15)

My code snippet is as below: 我的代码段如下:

var zombie = require("zombie");
zombie.waitDuration = '30s';
//Browser.waitDuration = '300s';
var assert = require("assert");

browser = new zombie({
    maxWait: 10000,
    waitDuration: 30*1000,
    silent: true
});
browser.visit("https://example.com", function () {
    // fill search query field with value "zombie"
    console.log("LOADEDDDD !!!!", browser.location.href);
    console.log(this.browser.text('title'));
    assert.equal(this.browser.text('title'), 'Welcome - Sign In');
    browser.fill('#user', 'user@example.com');
    browser.fill('#pass', 'pass@123');

    browser.document.forms[0].submit();


    console.log(browser.text('title'));
    // wait for new page to be loaded then fire callback function
    browser.wait(5000).then(function() {
    // just dump some debug data to see if we're on the right page
    console.log(this.browser.success);
    assert.ok(this.browser.success);
    console.log("Browser title:: --------- " + this.browser.text('title'));
    assert.equal(this.browser.text('title'), 'Dashboard');
    })
});

Please help me to resolve this issue. 请帮助我解决此问题。 I am stuck here for long duration. 我在这里呆了很长时间。 Thanks in advance! 提前致谢!

The first problem is that the assertion below fails since the www.example.com 's title is Example Domain not Welcome - Sign In 第一个问题是以下声明失败,因为www.example.com的标题为Example Domain not Welcome - Sign In

assert.equal(this.browser.text('title'), 'Welcome - Sign In');

Moreover, these lines will most probably also fail since there are no elements with such ids on the page. 此外,这些行很可能也会失败,因为页面上没有具有此类ID的元素。

browser.fill('#user', 'user@example.com');
browser.fill('#pass', 'pass@123');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未处理的 promise 拒绝导致加载错误 - Unhandled promise rejection causing load error NodeJs / Bluebird - 继续得到未处理的拒绝错误 - NodeJs/Bluebird - keep getting Unhandled rejection Error forEach未处理的拒绝错误 - Unhandled rejection error with forEach 未处理的拒绝错误Bluebird - Unhandled rejection error Bluebird UnhandledPromiseRejectionWarning:未处理的承诺拒绝。 - 当我尝试在 localhost:5000 上加载服务器时出现此错误 - UnhandledPromiseRejectionWarning: Unhandled promise rejection. - Get this error when I try and load up server on localhost:5000 业力 - Jasmine,未处理的 promise 拒绝:错误:无法加载“util” - Karma - Jasmine, Unhandled promise rejection: Error: Could not load "util" 未处理的拒绝(TypeError):分派不是在动作创建者中获取此错误的函数 - Unhandled Rejection (TypeError): dispatch is not a function getting this error in action creator 在 ReactJS 中获取错误为“未处理的拒绝(TypeError):that.setState 不是函数” - Getting error as “Unhandled Rejection (TypeError): that.setState is not a function” in ReactJS Unhandled Rejection undefined 不是对象错误 - Unhandled Rejection undefined is not an object error 在未处理的承诺拒绝中出错 - got an error in Unhandled promise rejection
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM