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