-1

I am using action sequences in protractor while running my spec i am facing this issue can anyone help why this is happening and how to solve it.

Below is my spec code:

describe("Actions demo", function(){
    it(" Open website ",function(){
        browser.get("http://posse.com/");
        element(by.model("userInputQuery")).sendKeys("river");
        browser.actions().mouseMove (element(by.model("locationQuery")))
            .sendKeys("London").perform()
        browser.actions.sendkeys(protractor.key.ARROW_DOWN);
        browser.actions.sendkeys(protractor.key.ENTER).perform();
    })
})
Geshode
  • 3,600
  • 6
  • 18
  • 32
Romita Thakur
  • 233
  • 1
  • 3
  • 8

2 Answers2

0

You should use protractor.Key.ARROW_DOWN instead of protractor.key.ARROW_DOWN.

You are using key with lowercase instead of Key with uppercase.

It should also be browser.actions().sendKeys(), actions() with parenthesis.

Silvan Bregy
  • 2,544
  • 1
  • 8
  • 21
0

In addition to Silvan response, remember to use .perform() at the end every usage of .actions() otherwise it will not work.

  • Welcome to SO! Please take the [tour], and read "[answer]" and its linked pages. Your answer is really a comment. – the Tin Man Feb 21 '22 at 18:40
  • Yes, but I don't have the power to comment on another's answers so I added it here. What should be the action course in your opinion? @theTinMan – Juan Canete Jul 13 '22 at 21:43
  • Silvan answer is not completed considering that if in Protractor you don't use .perform() for a chaininig secuence it'll fail silently. – Juan Canete Jul 13 '22 at 21:44