Linux Chrome driver on Sauce Labs causes spurious test failures #1329
Comments
|
Nevermind, that's a different thing. |
|
@shane-tomlinson This is caused by our autofocus logic in the BaseView. Is force autofocus logic only for IE < 10? Can we disable it for other browsers? |
|
@vladikoff - the autofocus logic is for Firefox, Chrome, and IE. Browsers usually only autofocus an element if the element is in the DOM before DOMContentLoaded. You can see the default browser behavior by commending out the
|
|
@karlht - can you copy over a log so we have a record of it and can use it to debug? |
|
@karlht - do the elements need to be focused before you send off key strokes to them? |
No need for the logs. I've already researched this problem over the last few days. Removing Here is a more detailed description with screenshots of what happens on SauceLabs or locally in Chrome: theintern/leadfoot#6 The ChromeDriver is a lot faster than the autofocus logic and autofocus causes the typing to fail. |
|
I'm in a laptops-closed QA work-week today, but I'll get a log copied over as soon as I can. |
|
@karlht see my above comment. Don't worry about the logs. Enjoy the work week :) |
I'm confused - what is the actual problem? Does the ChromeDriver enter in keyboard input and then we try to focus the element after some input has already been entered? Or, does the ChromeDriver enter input into the first field and move on to the second field before we have focused the first field? Or, another theory - we give the order to autofocus on view startup. The element focus() function is called. ChromeDriver fills out the first field, and moves onto the second field. The 'focus' event of the first field fires, and we try to update the selection back into the first field. I'm amenable to 1. I'd rather fix the problem if we can. I want to try changing the focus function to: focus: function (which) {
try {
var focusEl = this.$(which);
// place the cursor at the end of the input when the
// element is focused.
focusEl.one('focus', function () {
// focus was lost already. wah wah.
if (! focusEl.is(':focus')) {
return;
}
try {
this.selectionStart = this.selectionEnd = this.value.length;
} catch (e) {
// This can blow up on password fields in Chrome. Drop the error on
// the ground, for whatever reason, it still behaves as we expect.
}
});
focusEl.get(0).focus();
} catch (e) {
// IE can blow up if the element is not visible.
}
},The comment in the
Maybe it doesn't behave as expected? |
…red before the refocus occurs. Fixes Selenium/ChromeDriver where an attempt is made to autofocus an element after ChromeDriver has already moved on to the next element. The timing was: 1) A new view was rendered, an autofocus element found. 2) The autofocus element was focused, a timer set to check for focus 50ms later. 3) In that 50ms, ChromeDriver would fill out the field, and move on to the next field. 4) The timer expired, and the view tried to re-focus the autofocus element. 5) ChromeDriver failed the test. fixes #1329 (on a mac)
…ed is hidden. If the element is already visible, only attempt one focus. fixes #1329
…ed is hidden. If the element is already visible, only attempt one focus. fixes #1329


[Another Webdriver/Sauce problem.]
Running the test through a local Selenium/Webdriver works fine; running it on Sauce causes the error shown in the image below:
Test script is at https://github.com/karlht/services-tools/blob/master/fxa-webdriver-tests/multi123done.py -- results on Sauce are at https://saucelabs.com/tests/aa73da25fd354712903132015e5d50ca
Between this and #1324, I'm prepared to declare Sauce tests as 'nice for a first pass at possible problems, but not definitive' -- they require local and/or manual verification too much of the time.
The text was updated successfully, but these errors were encountered: