I am a beginner in protractor. I did the installations necessary for running protractor. When tried running the sample script mentioned in the protractor documentation, i am getting ETIMEDOUT error. and the url points to 127.0.0.1:4444. The same url is not accessible manually also. But when trying http://localhost:4444/wd/hub, page opens properly. I am not sure why the conf.js trying to access the 127.0.0.1:4444, even if i give the 'seleniumAddress' parameter to 'http://localhost:4444/wd/hub'. Please help me guys to resolve this issue
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);
});
});
127.0.0.1
.before executing the protractor test, enter the following commandsudo webdriver-manager update && webdriver-manager start
in a new terminal window and then executeprotractor conf.js
– Sudharsan Selvaraj