1
我試圖閱讀使用量角器和摩卡的網站上的所有HREF鏈接使用protractorjs和mocha如何閱讀網站上的所有鏈接?
我不是「已婚」的任何技術,但我的印象是,這些是目前最好的技術用於驅動硒。
我有與我從示例代碼調整讀取項目來到量角器摩卡示例文件的工作:這似乎是發生
before(function() {
driver = new webdriver.Builder().
usingServer('http://localhost:4444/wd/hub').
withCapabilities(webdriver.Capabilities.chrome()).build();
driver.manage().timeouts().setScriptTimeout(10000);
ptor = protractor.wrapDriver(driver);
});
function Log(obj){
console.log(JSON.stringify(obj));
}
it.only('should read all HREFS', function(done){
ptor.get('http://www.angularjs.org');
var elements = ptor.findElements(protractor.By.tagName('a'));
Log(protractor.By.tagName('a'));
// {"using":"tag name","value":"a"}
Log(elements);
// Result: {}
// Expected: a full list of every 'a' tag element on the angularjs homepage
});
是「元素」列表返回立即而不是頁面加載後。
我該如何處理硒+量角器?