Can't open popup

14 views
Skip to first unread message

Shane Wignall

unread,
Aug 3, 2016, 4:20:52 PM8/3/16
to CasperJS
I'm trying to click an image on a page that has an onclick function that opens a popup window. I have not been able to open this up through CasperJs. I have tried each of the following: 

casper.click("#selector")


casper.evaluate(function() { /*onclick function call*/ });


casper.sendKeys("#selector", casper.page.event.key.Enter);


casper.waitForPopup(/popup\.html$/, function() {
   
this.test.assertEquals(this.popups.length, 1);
});

casper
.withPopup(/popup\.html$/, function() {
   
this.test.assertTitle('Popup title');
});

            I always wrap the code within a "then" function to ensure that it is executed in the proper order. I test it by taking a screenshot (also wrapped in a "then" function), but the screenshot never contains the popup window that show appear. 

            What am I missing?

            Ken

            unread,
            May 25, 2017, 7:40:42 PM5/25/17
            to CasperJS
            Can you try again with latest CasperJS v1.1.4 and PhantomJS v2.1.1? There has been some fixes 1-2 months ago for popups which solves a few issues.
            Reply all
            Reply to author
            Forward
            0 new messages