0

TestCase: Right click on link element and open in NEW TAB or NEW WINDOW.

I could able to right click on the element using the below code . BUT NOT SURE HOW TO SELECT THE OPTION OF "OPEN Link in NEW TAB"

TRIED:

    browser.actions().mouseMove(rightClickEle).perform();
    browser.actions().click(protractor.Button.RIGHT).perform();

Any Help. Thanks in Advance.

0

Finally i sorted out the solution to "RIGHT CLICK AND OPEN IN NEWTAB"

var rightClickEle = browser.driver.findElement(by.xpath("//a[contains(text(),'linkA')]"));
browser.actions().mouseMove(rightClickEle).perform();
browser.actions().click(protractor.Button.RIGHT).perform();
browser.actions().mouseMove(rightClickEle).keyDown(protractor.Key.CONTROL).click().perform();
browser.actions().mouseMove(rightClickEle).keyDown(protractor.Key.CONTROL).click().keyUp(protractor.Key.CONTROL).perform();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.