0

I am having trouble trying to send Shift and then immediately tilde (~). I have tried several examples, here is one that I am trying. In the system - I am trying to test the next scenario - I need to choose a certain image, and then send shift ~ -> insert certain number, shift 3

shift 3 for example is an immediate action, can't wait between those two. Same for shift ~

browser.actions().mouseMove(imagePicked).perform();
         await imagePicked.click();
         await browser.actions().sendKeys(((protractor.Key.SHIFT,"~"))).perform();
         await browser.actions().sendKeys(barcode).perform();
         await browser.actions().sendKeys(((protractor.Key.SHIFT,"3"))).perform();

thanks in advance.

Shai
  • 43
  • 7

2 Answers2

0

Can you try this and if this still do not resolves your case, you can share stack trace or error message. browser.actions().keyDown(protractor.Key.SHIFT).sendKeys('~').perform();

cengiz sevimli
  • 1,461
  • 8
  • 19
0

finally, this helped me :

      await imagePicked.click();
     await browser.actions().sendKeys(protractor.Key.SHIFT,('~')).keyUp(protractor.Key.SHIFT).perform();
     await browser.actions().sendKeys(barcode).perform();
     await browser.actions().keyDown(protractor.Key.SHIFT).sendKeys('3').keyUp(protractor.Key.SHIFT).perform();

thanks all.

Shai
  • 43
  • 7