0

I am trying to select all the text present in a webpage. I am using sendKeys command but it is not working.

I have also tried with other keys constants and it works, but not when I use 'command+A'.

Here is the code used:

properties.homePage.editableText.click().sendKeys(protractor.Key.chord(protractor.Key.COMMAND,'A'));

What am I doing wrong?

The point is that if I put this code below, it writes an 'A' in the text one space left to end of the sentence because 'ARROW_LEFT' is working:

properties.homePage.editableText.click().sendKeys(protractor.Key.chord(protractor.Key.ARROW_LEFT,'A'));
Alfredo Bazo Lopez
  • 323
  • 1
  • 4
  • 12
  • Unfortunately, it looks like this will not work. Found this will searching for more info about your question. [This answer](https://stackoverflow.com/questions/25300034/sending-ctrla-combination-to-an-element) lead me to https://github.com/angular/protractor/issues/690 – tehbeardedone Dec 11 '18 at 18:00
  • Thanks anyway. Finally, I have done this: properties.homePage.editableText.click().sendKeys(protractor.Key.ALT,protractor.Key.SHIFT,protractor.Key.ARROW_LEFT); and it works. – Alfredo Bazo Lopez Dec 12 '18 at 14:57

0 Answers0