简体   繁体   中英

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.

我认为您必须将所需的密钥发送到浏览器对象,如下所示:

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM