我在量角器一個初學者。我做了運行量角器所需的設備。在嘗試運行量角器文檔中提到的示例腳本時,出現ETIMEDOUT錯誤。 url指向127.0.0.1:4444。也不能手動訪問相同的網址。但嘗試http://localhost:4444/wd/hub時,頁面可以正常打開。我不知道爲什麼conf.js嘗試訪問127.0.0.1:4444,即使我將'seleniumAddress'參數設置爲'http://localhost:4444/wd/hub'。請幫我人來解決這個問題獲取ETIMEDOUT錯誤時運行量角器conf.js
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['todo-spec.js']
};
describe('angularjs homepage todo list', function() {
it('should add a todo', function() {
browser.get('https://angularjs.org');
element(by.model('todoList.todoText')).sendKeys('write first protractor test');
element(by.css('[value="add"]')).click();
var todoList = element.all(by.repeater('todo in todoList.todos'));
expect(todoList.count()).toEqual(3);
expect(todoList.get(2).getText()).toEqual('write first protractor test');
// You wrote your first test, cross it off the list
todoList.get(2).element(by.css('input')).click();
var completedAmount = element.all(by.css('.done-true'));
expect(completedAmount.count()).toEqual(2);
});
});
本地主機是什麼,但它代表的IP地址'127.0.0.1'.before執行量角器測試,輸入以下命令'須藤的webdriver經理更新&& webdriver-manager start'在一個新的終端窗口中,然後執行'量角器conf.js' –