Abhishek S N
Abhishek S N

Reputation: 35

sendKeys(protractor.Key.Tab) is not working

I'm using protractor with Javascript. SendKeys(protractor.Key.TAB) is not tabbing out from the input field.

Below is the html tag input tag:

<td>
  <input class="ng-pristine ng-untouched ng-valid" type="text" placeholder="Add a new member" ng-blur="addMember()" ng-model="newMemberText"/>
</td>

Below is the protractor code snippet i wrote:

this.When(/^add member to registration$/, function () {
    var abc= element(by.model('newMemberText'));
    abc.sendKeys('print');
    abc.sendKeys(protractor.Key.TAB);
});

I have even tried abc.sendKeys(KeyboardEvent.TAB). Both of them are not working.

Upvotes: 1

Views: 3542

Answers (2)

flaviomeira10
flaviomeira10

Reputation: 586

I think you must send the desired key to the browser object, like this:

browser.actions().sendKeys(protractor.Key.TAB).perform();

Upvotes: 1

alecxe
alecxe

Reputation: 473853

This sounds related to Keys.ENTER, Keys.TAB, Keys.SPACE are not working on Chrome 44.

What you need to do:

  • update Chrome itself to the latest stable version
  • update chromedriver to the latest version

Or, if that does not solve your issue, you can always switch to Firefox.

Upvotes: 0

Related Questions