sendKeys(protractor.Key.TAB) has no effect
A test that tabs through form fields and routinely works suddenly ceased to do so in the past couple of days. The relevant source:
beforeEach(function () {
firstLabel.click();
firstField.click();
});
it("should become invisible when tabbed out", function () {
firstField.sendKeys(protractor.Key.TAB);
expect(firstField.isDisplayed()).toBeFalsy();
});
protractor.Key.TAB is defined and in the console prints out the equivalent of '\uE004'
The test is running on the latest version of Chrome. Some of the npm devDependencies are:
[email protected] node_modules/gulp-protractor
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
And output from jar updates reads:
Updating selenium standalone
downloading https://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar...
Updating chromedriver
downloading https://chromedriver.storage.googleapis.com/2.15/chromedriver_mac32.zip...
chromedriver_2.15.zip downloaded to [path]/node_modules/gulp-protractor/node_modules/protractor/selenium/chromedriver_2.15.zip
selenium-server-standalone-2.45.0.jar downloaded to [path]/node_modules/gulp-protractor/node_modules/protractor/selenium/selenium-server-standalone-2.45.0.jar
More info: This works in Firefox but not in Chrome
describe('Test', function () {
it('should browse to google', function () {
browser.ignoreSynchronization = true;
browser.driver.get('https://www.google.de');
expect(browser.getCurrentUrl()).toEqual('https://www.google.de/');
});
it('should unfocus the search field', function () {
var search = element(by.name('q'));
search.sendKeys(protractor.Key.TAB);
browser.sleep(3000); // 3s to take a look ;)
});
});
Credit: http://stackoverflow.com/questions/28410273/how-to-send-keyboard-keys-in-protractor-like-tab
Can confirm we're also having this issue. It doesn't seem to work using action sequence either:
browser.actions().sendKeys(protractor.Key.TAB).perform()
I see the problem in FF but not in Chrome.
On Thu, Jul 23, 2015 at 5:52 PM, James Bunt [email protected] wrote:
Can confirm we're also having this issue. It doesn't seem to work using action sequence either:
browser.actions().sendKeys(protractor.Key.TAB).perform()
— Reply to this email directly or view it on GitHub https://github.com/angular/protractor/issues/2370#issuecomment-124249246 .
just out of curiosity - can you try to detect a blur() instead of tabbing out?
+1 also having this issue, and notably have not updated protractor either. It seems this is either a chrome update or a webdriver update of some kind.
I got the same problem and this was working couple days ago, I believe as well that it's the Chrome update that is now causing this issue.
My Chrome version is Version 44.0.2403.89 m (64-bit)
I've also just experienced this issue.
I have the same problem with Protractor 2.1.0. With update to chrome version 44.0.2403.89 m WebElement.sendKeys(protractor.Key.UP) will not work anymore.
Seems to be an issue not only with protracotr:
https://code.google.com/p/chromedriver/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Status%20Pri%20Owner%20Summary&groupby=&sort=&id=1159
with elementExplorer:
browser.ignoreSynchronization = true
browser.get('https://github.com/angular/protractor/issues/new')
//this works:
element(by.name('q')).sendKeys('derp');
//this works:
element(by.name('q')).sendKeys(protractor.Key.BACK_SPACE)
//this doesn't:
element(by.name('q')).sendKeys(protractor.Key.TAB)
Is this not how you're supposed to get protractor to tab away from elements? It used to work: http://stackoverflow.com/questions/28410273/how-to-send-keyboard-keys-in-protractor-like-tab but my tests started failing this week after updating webdriver.
( Celebrate the little victories - good job me for not creating a duplicate issue 🙌 )
Oh, we experience the issue as well, it breaks our tests! :( Do you have a workaround for this? Downgrading for old versions of protractor didn't help...
Breaking tests here too :/
Breaking my tests as well.
Same here, tests are broken on Chrome 44.
This is now fixed in the latest version of Chrome! Finally.
Thank you for heads up @ashaffer
Fixed with https://code.google.com/p/chromium/issues/detail?id=513768
Again broken in chrome version 53 with protractor version 4.0.0 [also with 4.0.9]. Was working wit 52nd version of chrome. Does other also face the same problem?
yes, I got the same problem
Same problem with Protractor 4.0.9 and Chrome 53.0.2785.116 m (64-bit).
I am on Chrome Version 53.0.2785.143 m and see the same problem. Has somebody opened an issue for this on Chrome yet?