New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protractor: sendKeys(protractor.Key.TAB); does not work with the newest Chrome Version?? #3530

Closed
J0nesP opened this Issue Sep 8, 2016 · 6 comments

Comments

Projects
None yet
5 participants
@J0nesP

J0nesP commented Sep 8, 2016

Hi there!

Bug report:
Since I've installed the newest Chrome Version, some of my Protractor Tests are failing. With the new Version my Method "sendKeys(value, protractor.Key.TAB);" does not work properly. Protractor does not leave the Field with TAB. So the Value in the Field does not change. Same issue with the "protractor.Key.ENTER".

A friend of mine looked up his chrome Version and also got the Update. Since then his Tests are also failing.

The Testcase below worked fine with an Chrome Version < 53.0.2785.101

  • Node Version: 'using node@v6.3.0`; 'using npm@3.10.3'
  • Protractor Version: using protractor 4.0.4
  • Browser(s): `Chrome, Version 53.0.2785.101 m (64-bit)'
  • Operating System and Version Windows 7 64 bit
  • Your protractor configuration file

protractor.conf.js.txt

  • A relevant example test
    My Inputfield Object:
    var duration = element(by.id('timepicker_input'));

Method to send keys into the Field:
this.setDurationWithBlur = function (value) {
duration.clear().sendKeys(value, protractor.Key.TAB);
};

Method to get the Value:
this.getDuration = function () {
return duration.getAttribute('value');
};
Testcase:
it('Testfall 9: GIVEN: Timepicker Iniwert = "08:15" WHEN: Wert 09:27 wird eingegeben + Fokusverlust mit TAB THEN: Timepickerwert = "09:27"', function () {
timePickerTestElement.setDurationWithBlur('09:27');
expect(timePickerTestElement.getDuration()).toBe('09:27');
})

  • Output from running the test:
    PNG: As you can see, the Cursor is still in the field
    032912c1cb5c0b64fadb5896716603d2

Output in the Shell:
3) Funktionstest timePickerElement (Test): Testfall 9: GIVEN: Timepicker Iniwert = "08:15" WHEN: Wert 09:27 wird eingegeben + Fokusverlust mit TAB THEN: Timepickerwert = "09:27"
Message:
Expected '0927' to be '09:27'.
Stack:
Error: Failed expectation
at Object. (D:\01_trunk\cross2\client\cfach\terminplaner\app\web_spinnerplayground\app\timepicker.e2e-spec.js:58:57)
at D:\programme\nodejs\node_modules\protractor\node_modules\jasminewd2\index.js:96:23
at new ManagedPromise (D:\programme\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1082:7)
at controlFlowExecute (D:\programme\nodejs\node_modules\protractor\node_modules\jasminewd2\index.js:82:18)
at TaskQueue.execute_ (D:\programme\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2913:14)
at TaskQueue.executeNext_ (D:\programme\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2896:21)
at asyncRun (D:\programme\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2820:25)
at D:\programme\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:639:7

  • Steps to reproduce the bug

Feature Request
Could you please look into this issue.
I am currently using Chrome Driver 2.22 could this be the Problem?

Thanks 4 investigating.

@cnishina cnishina added this to the Upcoming milestone Sep 8, 2016

@cnishina

This comment has been minimized.

Show comment
Hide comment
@cnishina

cnishina Sep 10, 2016

Member

I believe this is an assumption on what the selenium Key.TAB produces. When you are on the page, you press tab with your keyboard and it navigates to a different page. When you use Key.TAB, it creates an actual tab on the input field.

Trying this out with elementexplorer with the protractor testapp.

Terminal 1:
npm start

Terminal 2:

>: ./bin/elementexplorer.js

browser.get('http://127.0.0.1:8081/ng1/');
element(by.model('username')).clear().sendKeys('this is a tab: ', protractor.Key.TAB, '.');
element(by.model('aboutbox')).clear().sendKeys('this is a return: ', protractor.Key.RETURN, '.');

This is similar to the Key.RETURN. The assumption is that pressing the return key on a form should also submit the form. It might if your input field is waiting for a return. Also note that the Key.RETURN works in the example and does create a new line.

Member

cnishina commented Sep 10, 2016

I believe this is an assumption on what the selenium Key.TAB produces. When you are on the page, you press tab with your keyboard and it navigates to a different page. When you use Key.TAB, it creates an actual tab on the input field.

Trying this out with elementexplorer with the protractor testapp.

Terminal 1:
npm start

Terminal 2:

>: ./bin/elementexplorer.js

browser.get('http://127.0.0.1:8081/ng1/');
element(by.model('username')).clear().sendKeys('this is a tab: ', protractor.Key.TAB, '.');
element(by.model('aboutbox')).clear().sendKeys('this is a return: ', protractor.Key.RETURN, '.');

This is similar to the Key.RETURN. The assumption is that pressing the return key on a form should also submit the form. It might if your input field is waiting for a return. Also note that the Key.RETURN works in the example and does create a new line.

@kimx

This comment has been minimized.

Show comment
Hide comment
@kimx

kimx Sep 10, 2016

Press tab with input,It should be jump to next input,right?

kimx commented Sep 10, 2016

Press tab with input,It should be jump to next input,right?

@J0nesP

This comment has been minimized.

Show comment
Hide comment
@J0nesP

J0nesP Sep 12, 2016

When I press tab in the input field via Keyboad, it doesn't navigate to a different page. The Curser jumps to the nex input (as kimx stated).

When I send protractor.Key.TAB to the Field, it does nothing! As you can see in the PNG I have uploaded. The Curser is still in the same field and the tab in the field is also missing. This can't be right.

Not to mention, that the protractor.Key.TAB was tabbing to the next input with the old Chrome Version. What can i do? Install an old Chrome Version?

J0nesP commented Sep 12, 2016

When I press tab in the input field via Keyboad, it doesn't navigate to a different page. The Curser jumps to the nex input (as kimx stated).

When I send protractor.Key.TAB to the Field, it does nothing! As you can see in the PNG I have uploaded. The Curser is still in the same field and the tab in the field is also missing. This can't be right.

Not to mention, that the protractor.Key.TAB was tabbing to the next input with the old Chrome Version. What can i do? Install an old Chrome Version?

@Andrucis

This comment has been minimized.

Show comment
Hide comment
@Andrucis

Andrucis Sep 13, 2016

@J0nesP we also encountered this problem in protractor tests that we use for our solution. The way we fixed it is described here: http://stackoverflow.com/a/20579881

Andrucis commented Sep 13, 2016

@J0nesP we also encountered this problem in protractor tests that we use for our solution. The way we fixed it is described here: http://stackoverflow.com/a/20579881

@kohatang

This comment has been minimized.

Show comment
Hide comment
@kohatang

kohatang Sep 15, 2016

I have same issue, so I update chromedriver to 2.24(chromedriver_mac64.zip), it worked.

kohatang commented Sep 15, 2016

I have same issue, so I update chromedriver to 2.24(chromedriver_mac64.zip), it worked.

@J0nesP

This comment has been minimized.

Show comment
Hide comment
@J0nesP

J0nesP Sep 21, 2016

I tried the stackoverflow suggestion (http://stackoverflow.com/a/20579881). It worked a little bit (I got some crazy Error messages).

In the end i updated the chromedriver to 2.24 and everything worked :)
@koihatano : Thanks a lot :)

J0nesP commented Sep 21, 2016

I tried the stackoverflow suggestion (http://stackoverflow.com/a/20579881). It worked a little bit (I got some crazy Error messages).

In the end i updated the chromedriver to 2.24 and everything worked :)
@koihatano : Thanks a lot :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment