Protractor - Enter a key that does not work

I am trying to run some translator tests in Safari (they work fine in Chrome).

The problem is that the return key does not work correctly in the method sendKeys(). The value is not sent (- is undefined)

Here is what I did on the input object:

input.sendKeys(value + '\n');

I have also tried input.sendKeys(value + protractor.Key.ENTER);

But getting the same results.

+3
source share
2 answers

According to the webdriverjs doc , the correct syntax is as follows:

input.sendKeys(value, protractor.Key.ENTER);

You also tried to send the text and enter key separately:

input.sendKeys(value);
input.sendKeys(protractor.Key.ENTER);
+7
source

You should do something like this:

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

, (, SHIFT + TAB):

browser.actions().sendKeys(protractor.Key.SHIFT, protractor.Key.TAB).perform();
0

All Articles