Casper.waitFor() timeout Problem

1,736 views
Skip to first unread message

Sanjay M

unread,
Apr 4, 2013, 10:27:39 AM4/4/13
to casp...@googlegroups.com
Hi I tried to run my script, but getting this timeout error. Even itried to increase the time also.

[root@Cloud360Console CasperJS]# casperjs test SettingCreateDeleteTestCase.js
Test file: SettingCreateDeleteTestCase.js
[info] [phantom] Starting...
[info] [phantom] Running suite: 94 steps
[debug] [phantom] opening url: http://10.236.194.195/cloudone-ui-0.0.1-SNAPSHOT/login/login.cl?, HTTP GET
[debug] [phantom] Navigation requested: url=http://10.236.194.195/cloudone-ui-0.0.1-SNAPSHOT/login/login.cl?, type=Other, lock=true, isMainFrame=true
[debug] [phantom] url changed to "http://10.236.194.195/cloudone-ui-0.0.1-SNAPSHOT/login/login.cl?"
[debug] [phantom] Successfully injected Casper client-side utilities
[debug] [phantom] start page is loaded
[info] [phantom] Step 3/94 http://10.236.194.195/cloudone-ui-0.0.1-SNAPSHOT/login/login.cl? (HTTP 200)
[info] [phantom] Step 3/94: done in 308ms.
[warning] [phantom] Casper.waitFor() timeout
[warning] [phantom] wait timeout of 5000ms reached
â Â Â wait timeout of 5000ms reached

[root@Cloud360Console CasperJS]# 6c


My Script :


var x = require('casper').selectXPath;
var casper = require('casper').create({
    verbose:             true,
    logLevel:             "debug",
    onError:            null,
    onLoadError:        null,
    onPageInitialized:  null,
    onTimeout:          null,
    page:               null,
    onStepTimeout:      null,
    stepTimeout:        null,
    pageSettings: {
         loadImages:  true,         // The WebPage instance used by Casper will
         loadPlugins: true,         // use these settings
         userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4'
    },
    timeout:            null
});
//casper.options.waitTimeout = 90000;
//casper.defaultWaitTimeout = 60000;
casper.options.stepTimeout = 20000;
casper.defaultWaitForTimeout = 20000;
casper.options.viewportSize = {width: 1366, height: 663};
// Print out all the Cloud360 messages in the headless browser context
casper.on('remote.message', function(msg) {
    this.echo('remote message caught: ' + msg);
});
// Print out all the Cloud360 messages in the headless browser context
casper.on("page.error", function(msg, trace) {
    this.echo("Page Error: " + msg, "ERROR");
});
phantom.cookiesEnabled = true;
casper.start('http://10.236.194.195/cloudone-ui-0.0.1-SNAPSHOT/login/login.cl?');
casper.waitForSelector("form[name=loginform] input[type=submit][value='Signing in...']",
    function success() {
        this.test.assertExists("form[name=loginform] input[type=submit][value='Signing in...']");
        this.click("form[name=loginform] input[type=submit][value='Signing in...']");
    },
    function fail() {
        this.test.assertExists("form[name=loginform] input[type=submit][value='Signing in...']");
});
// submit form
casper.waitForSelector(x("//a[normalize-space(text())='Instance Groups']"),
    function success() {
        this.test.assertExists(x("//a[normalize-space(text())='Instance Groups']"));
        this.click(x("//a[normalize-space(text())='Instance Groups']"));
    },
    function fail() {
        this.test.assertExists(x("//a[normalize-space(text())='Instance Groups']"));
});
casper.waitForSelector("form[name=appgroupActionFormId] input[type=button][value='Create New']",
    function success() {
        this.test.assertExists("form[name=appgroupActionFormId] input[type=button][value='Create New']");
        this.click("form[name=appgroupActionFormId] input[type=button][value='Create New']");
    },
    function fail() {
        this.test.assertExists("form[name=appgroupActionFormId] input[type=button][value='Create New']");
});
casper.waitForSelector("form[name=popupsCreateFormId]",
    function success() {
        this.fill("form[name=popupsCreateFormId]", {"popupsCreateFormId:appgroupName": "AutoIG"});
    },
    function fail() {
        this.test.assertExists("form[name=popupsCreateFormId]");
});
casper.waitForSelector("form[name=popupsCreateFormId]",
    function success() {
        this.fill("form[name=popupsCreateFormId]", {"popupsCreateFormId:appgroupDesc": "AutoIG"});
    },
    function fail() {
        this.test.assertExists("form[name=popupsCreateFormId]");
});
casper.waitForSelector("form[name=popupsCreateFormId] input[type=button][value='processing..']",
    function success() {
        this.test.assertExists("form[name=popupsCreateFormId] input[type=button][value='processing..']");
        this.click("form[name=popupsCreateFormId] input[type=button][value='processing..']");
    },
    function fail() {
        this.test.assertExists("form[name=popupsCreateFormId] input[type=button][value='processing..']");
});
casper.then(function() {
    this.mouse.click(641, 291);
});
casper.waitForSelector(x("//a[normalize-space(text())='Delete']"),
    function success() {
        this.test.assertExists(x("//a[normalize-space(text())='Delete']"));
        this.click(x("//a[normalize-space(text())='Delete']"));
    },
    function fail() {
        this.test.assertExists(x("//a[normalize-space(text())='Delete']"));
});
casper.waitForSelector("form input[type=button][value='Yes']",
    function success() {
        this.test.assertExists("form input[type=button][value='Yes']");
        this.click("form input[type=button][value='Yes']");
    },
    function fail() {
        this.test.assertExists("form input[type=button][value='Yes']");
});

casper.run(function() {this.test.renderResults(true);});


Thanks,

Sanjeevi M


Reply all
Reply to author
Forward
0 new messages