Selenium + mochaでURLにアクセスする際に問題が発生しました。これは私が使用しているコード行です。FirefoxでSelenium get(url)問題が発生しました
return driver.get('http://localhost/ClickSuscribe/#/MisProductos')
私は角のURLにいくつかの問題があることがわかりましたが、解決策は見つかりませんでした。
it("Is visible", function() {
if(viable)
{
return driver.findElements(webdriver.By.id('activarMiSitio')).then(function(misProductos){
misProductos[0].getAttribute("class").then(function(webElement){
if(webElement==='ng-hide')
{
console.log('Element not found');
}
else{
console.log('Element exists');
}
}).then(function(){
driver.sleep(500);
//return driver.get('http://localhost/ClickSuscribe/#').catch(r => console.log(r));
return driver.get('http://localhost/ClickSuscribe/#/MisProductos').catch(r => console.log(r));
});/*.then(function(){
driver.sleep(2000);
return driver.getCurrentUrl();
}).then(function(currentUrl){
driver.sleep(1000);
console.log(currentUrl);
});*/
});
}
return console.log("No está loggeado");
});
PS:これはChromeとIEで動作し
エラーがError: timeout of 40000ms exceeded. Ensure the done() callback is being called in this test.
であるこれは、テストケースです。セレンには、アンカーまたはポンドのURL「#」を処理する問題があるようです。
は、メソッドまたはスクリプトの実行を取得する際の問題ですか? –
@MohamedELAYADI私は実際にはわかりませんが、getメソッドを使用している可能性が最も高いと思われます。約1分間そこにいれば、次のテストが続行されるからです。 –