question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Right click is not performed on Chrome v75. Instead a left click action is performed.

See original GitHub issue

Bug report

I have some tests trying to simulate a right click as follows:

  browser.actions().mouseMove($('#id')).perform();
  browser.actions().click(protractor.Button.RIGHT).perform();

It worked fine on following configuration:

Chrome V74 ChromeDriver V74 selenium-server-standalone-3.141.59.jar “@types/node”: “^12.0.10”, “jasmine”: “^3.4.0”, “protractor”: “^5.4.2”, “typescript”: “^3.5.2”, “webdriver-manager”: “^12.1.5”

After updating Chrome and ChromeDriver to V75 right click is no longer performed. A left click is performed instead.

I found following workaround: If I set ‘directConnect’ property to true the right click is performed. Using directConnect is not an option since we also want to run tests on IE.

  • Node Version: 12.0.10
  • Protractor Version: 5.4.2
  • Browser(s): Chrome 75
  • Operating System and Version Windows 10
  • Protractor configuration file
exports.config = {
    // launch locally when fields directConnect and seleniumAddress are not provided
    //directConnect: true,
    chromeDriver: 'C:\\source\\protractorProj\\drivers\\chromedriver.exe',
    seleniumServerJar: 'C:\\source\\protractorProj\\drivers\\selenium-server-standalone-3.141.59.jar',
    specs: ['C:\\source\\protractorProj\\specs\\tests.js'],
    capabilities: {
      browserName: 'chrome'
    }
  }
  • A relevant example test
   import {browser, $, protractor} from 'protractor'

  describe('Protractor Typescript Demo', function() {
	it('title verifications', function() {
	  browser.get('https://talis.github.io/ng-context-menu/#/');
	  browser.sleep(3000);browser.actions().mouseMove($('#panel-0 .panel-body')).perform();
          browser.actions().click(protractor.Button.RIGHT).perform();
          browser.sleep(5000);

          browser.actions().mouseMove($('a')).perform();
          browser.actions().click(protractor.Button.RIGHT).perform();
          browser.sleep(2000);
	});
});

I run the test with following command: “protractor conf.js”

Request

I would expect that the right click is performed as in previous versions.

I also did a test in Java using Selenium and the right click was done correctly both on Chrome 74 and 75 by using these lines of code WebElement elementLocator = driver.findElement(By.id(“ID”)); actions.contextClick(elementLocator).perform();

So I suppose there is something related to the way protractor sends the right click event and the way chromedriver handles it

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

3reactions
Leeron2010commented, Aug 13, 2019

I have the same issue. It’s weird but “directConnect: true,” fix this issue. Never the less this is not acceptable for me ((

2reactions
harsha509commented, Aug 17, 2019

Hi @alexcergau, @raketenolli

enabling the below capability enables chrome 74+ to use legacy API. Please try it works.

‘goog:chromeOptions’: { w3c: false }

Thanks !

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to troubleshoot right-click not working on Chrome and ...
You have to press and hold down the Shift key while you perform the right-click.
Read more >
Why does my right click not work on Chrome?
If the right click only doesn't work in Windows Explorer , then you can restart it to see if it fixes the problem:...
Read more >
mouse has reversed.Right click is now left ...
Right click is now left click,left click now right click. Can´t zoom in or out. mouse not working correctly.left click is right click,right...
Read more >
Alt+Left click is interpreted as right-click on a 2-button mouse.
you can see this by using the touchpad and hold down alt and doing a left click. This is working as intended. Closing...
Read more >
Sign In With Google HTML API reference | Authentication
The ID token credential response is posted to your login endpoint when no callback function is defined and a user clicks on the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found