Pages

Protractor press Ctrl + A ?

 How to press Ctrl + A in protractor ?

In protractor we can press keys by using sendKeys function.

Please see below code script:
describe('Protractor press Ctrl + A', function () {
it('Code script for press Ctrl+A', function () {
var anyWebElement = element(by.css("#cssSelector"));
pressCtrlA(anyWebElement);
});

function pressCtrlA(element) {
element.sendKeys("", protractor.Key.chord(protractor.Key.CONTROL, "a"), "").then(
console.log("Ctrl + A keys are clicked")
);
}
});
>>We can press keys for CONTROL,SHIFT,ALT as well.
Protractor Press Ctrl + A keys
Please comment below to feedback or ask questions.

No comments:

Post a Comment

Please comment below to feedback or ask questions.