I am using osx 10.9.2, protractor 0.21.0, selenium-server-standalone 2.40.0 and chromedriver 2.9.
I am having problems that (I believe) are caused by the window focusing issue.
When I run my e2e test using a protractor, a browser window will be displayed, but my terminal will still be in the spotlight. This can be seen from the “Terminal”, which is still displayed in my menu bar, and not “Chrome” (osx behavior indicating which application is in focus).
I tried to correct the situation by doing this to no avail:
browser.driver.getAllWindowHandles().then(function(handles) {
console.log(handles[0]);
browser.driver.switchTo().window(handles[0]);
});
This situation causes some of my tests to fail. For example, tests involving clicking on a field using bootstrap datepicker will not show the calendar, and my test will not be able to interact with the datepicker calendar.
The situation is even worse on firefox. Firefox will not even show a drop-down menu when clicked if the browser is not in focus.
It's funny when I click the browser window manually after it is first shown, the tests will work fine.
When I tried a different approach: Running a test on a newly installed debian linux still does not work. The behavior is similar to that described above.
These are my configuration files: https://gist.github.com/giosakti/ca24a13705d15f4374b0
source
share