Right click is not performed on Chrome v75. Instead a left click action is performed.
See original GitHub issueBug 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:
- Created 4 years ago
- Reactions:1
- Comments:5
Top GitHub Comments
I have the same issue. It’s weird but “directConnect: true,” fix this issue. Never the less this is not acceptable for me ((
Hi @alexcergau, @raketenolli
enabling the below capability enables chrome 74+ to use legacy API. Please try it works.
‘goog:chromeOptions’: { w3c: false }
Thanks !