无法点击带有casperjs

时间:2015-12-22 13:00:00

标签: casperjs

这是我的代码我想接受确认对话但我无法捕捉对话但是我点击了正确的选择器。我希望在出现对话窗口的地方会触发popup.loaded事件。

enter image description here

 casper.test.begin('Sign up with Yahoo' , 2 , function(test) {   

casper.on('popup.loaded', function () {
 this.echo("HELLOOPOPUP")
});

x=require('casper').selectXPath;
casper.start("file:///home/sb/mytest/casperlogin-master/caspertest/ak.html" , function() {

this.wait(3000, function() {    
this.on('popup.loaded', function () {
   this.echo("HELLOOPOPUP")
});


this.click(x('/html/body/div[6]/div/div[11]/div/button'));    
});

    this.wait(2000, function() {

this.setFilter('page.confirm', function(message) {
    return true;
});
})

});


});
 casper.run(function() {
 });

标记链接: https://drive.google.com/file/d/0B5Nj-vLTRyujTm1zeGdZbmVmcnc/view?usp=sharing

0 个答案:

没有答案
相关问题