2

After referring to: PROTRACTOR: Right click on link and open in NEW TAB

I tried below code :

    describe('Right click', function () {
    
    
      it('test {Regression} {Sanity} {Sanity}', async function () {
        var EC = protractor.ExpectedConditions;
    
        await browser.get("https://www.onlinemictest.com/mouse-test/");
        let b=await browser.getProcessedConfig()
        console.log(b.capabilities.browserName)
        var rightClickEle = await $('.webcam-2-icon_');
        await browser.actions().mouseMove(rightClickEle).perform();
        await browser.actions().click(protractor.Button.RIGHT).perform();
        await browser.sleep(7000)
    });
    });

But it's not doing right-click, its always going for left click. Could someone help me out here?

2

https://github.com/angular/protractor/issues/5271

There is known bug

The work around is to disable w3c protocol in your config file:

capabilities: {
  'browserName': 'chrome' ,

'chromeOptions': {
//args:['version']
w3c: false
//},//11 or 'safari'*/
}},

For microsoft webdriver: (Edge)

Create a bat (say a.bat) file with below content (assuming the driver is in c)

C:\MicrosoftWebDriver.exe %* --jwp

Now pass this as the dge webdriver using jvmArgs

exports.config = {

specs: ['spec.js'],

//seleniumAddress:"http://localhost:4444/wd/hub",
localSeleniumStandaloneOpts: {
    port:5000,
  jvmArgs: ['-Dwebdriver.edge.driver=a.bat'],
},


capabilities: {
  'browserName': 'MicrosoftEdge' ,
},

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.