Reputation: 2182
I am getting really weird error. In my test, I first navigate to angularjs.org. Then I sendKeys() to an input field called "JavaScript Projects" which has filters in it. After that I click a checkbox and mark a todo item as Done. However, on doing this, it get the error,
UnknownError: unknown error: Element is not clickable at point (713, 6). Other element would receive the click: ... (Session info: chrome=43.0.2357.81)
If I reverse the order of my execution above, no error occurs.
Here is my Code
var util = require ('util');
describe ("Page object text", function() {
var homepage = require('../pages/angularjs_page.js');
it ("Should mark an item done", function() {
homepage.get();
browser.sleep(2000);
homepage.searchText('jquery');
homepage.markDoneTodo(0);
});
});
Here is the page object code:
var angularjs_page = function() {
this.get = function() {
browser.get('http://www.angularjs.org');
};
this.markDoneTodo = function(index) {
element.all(by.repeater('todo in todoList.todos'))
.get(index)
.element(by.model('todo.done'))
.click();
};
this.searchText = function(txt) {
element(by.model('projectList.search')).sendKeys(txt);
};
};
module.exports = new angularjs_page();
Maximizing the browser window did not work. Sleep() does not seem to be causing this issue. Inserting a sendKey() method in between works fine.
browser.sleep(2000);
homepage.searchText('jquery');
homepage.enterName("Hello World");
homepage.markDoneTodo(0);
So, what is wrong with executing searchText() and markDoneTodo() methods in sequence?
Problem Found Turns out that the static top navigation menu bar was overlapping the checkboxes. Is scrolling the best way to solve it, and how?
Upvotes: 0
Views: 335
Reputation: 2182
Using scroll solved the problem.
browser.executeScript('window.scrollTo(0,document.body.scrollHeight)');
Upvotes: 1