2016-01-15 10 views
0

我測試的網站,然後我遇到一個環節我想開並繼續測試第二網頁如何在casperjs中加載另一個頁面?

casper.start('http://Firstsite.com', function() { 
//blablah my codeing 


    casper.start('http://Secondesite.com', function() { 
    //blablah my codeing for ('http://Secondesite.com',) 
    }); 


}); 
+0

嗨一個非常簡單的解決方案,我認爲這已經回答在這[帖子](http://stackoverflow.com/questions/24880671/how-to-open-a-new-tab-in-casperjs)。無論如何,爲什麼你不保存當前的網址,然後做你的東西,並返回到保存的網址? – dasmelch

+0

@dasmelch謝謝,我在發佈問題之前看到了所有帖子,但我正在尋找一個簡單的解決方案。請參閱下面的答案。 –

回答

1

我發現在Casperjs文檔頁面http://docs.casperjs.org/en/latest/modules/casper.html#

casper.start('http://Firstsite.com', function() { 
//blablah my codeing 


    casper.thenOpen('http://Secondesite.com', function() { 
    //blablah my codeing for ('http://Secondesite.com',) 
    }); 


}); 
相關問題