Pages

How to doubleClick() an element in protractor ?

 How to doubleClick() an element in protractor ?

>> In protractor we can double click an element (button,text etc.,.) using doubleClick() method which is provided in actions().

Please check below code script:

First write xpath with help of DOM

doubleClick() in protractor
doubleClick()


Here we have 1 button welcome, when we double click that button, a message will display under that button how many times we have clicked the button.

describe('Protractor - doubleClick()', function () {
it(
'Code script to use doubleClick() in protractor', function () {
browser.
get("https://keeplearners.blogspot.com/2018/03/Angular-elements.html");

var doubleClickButton = element(by.css("button#doubleClick"));

browser.actions().doubleClick(doubleClickButton).perform();
});
});
Output:
It will return total number of matching elements found.
doubleClick() in protractor
doubleClick()
Please comment below to feedback or ask questions.

No comments:

Post a Comment

Please comment below to feedback or ask questions.