Text not on page even though this.waitForText(text) worked.

30 views
Skip to first unread message

Rick

unread,
Apr 30, 2013, 10:11:48 AM4/30/13
to casp...@googlegroups.com
As one of several steps I have this:

casper.then(
    function() {

        this.clickLabel('View New Content', 'a');

        this.waitForText('Explore content');

        fs.write('page-3.html', this.page.content, 'w');
    }
);

This succeeds with no errors or warnings and continues to a run step and exits.

Logically it seems that when I look at the dumped page the text should be there. However when I look at the code on the page there is no "Explore content" on the page.  I've looked with Chrome show source and also loaded the page into a text editor.

Does anyone have any idea what is happening here?

Nicolas Perriault

unread,
May 1, 2013, 8:40:43 AM5/1/13
to casp...@googlegroups.com
On Tue, Apr 30, 2013 at 4:11 PM, Rick <wil...@gmail.com> wrote:

> Does anyone have any idea what is happening here?

Please try this:

casper.then(function() {
this.clickLabel('View New Content', 'a');
});

casper.waitForText('Explore content', function() {
fs.write('page-3.html', this.page.content, 'w');
});

Writing in file should be done when the wait has been actually done.

++

--
Nicolas Perriault
https://nicolas.perriault.net/
Phone: +33 (0) 660 92 08 67
Reply all
Reply to author
Forward
0 new messages