browser.actions()._ HTTP method not allowed
Bug report
- Node Version:
12.13.0 - Protractor Version:
5.4.0 - Angular Version:
8.2.13 - Browser(s):
Chrome (78.0.3904.70), FireFox (70.0) - Operating System and Version
Ubuntu 19.04 - Your protractor configuration file
const { SpecReporter } = require('jasmine-spec-reporter');
const HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter');
const path = require('path');
const screenshotReporter = new HtmlScreenshotReporter({
dest: path.join(__dirname, '../../../e2e-report/public'),
filename: 'public.html'
});
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
multiCapabilities: [
{
'browserName': 'chrome',
chromeOptions: {
args: [
'--window-size=1980,1020',
'--headless'
]
}
},
{
'browserName': 'firefox',
firefoxOptions: {
args: [
'--window-size=1980,1020',
'--headless'
]
},
'moz:firefoxOptions': {
args: [
'--window-size=1980,1020',
'--headless'
]
}
},
],
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {
}
},
beforeLaunch() {
return new Promise(resolve => {
screenshotReporter.beforeLaunch(resolve);
});
},
async onPrepare() {
require('ts-node').register({
project: path.join(__dirname, './tsconfig.json')
});
protractor.browser.waitForAngularEnabled(false);
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
jasmine.getEnv().addReporter(screenshotReporter);
},
afterLaunch(exitCode) {
return new Promise(resolve => {
screenshotReporter.afterLaunch(resolve.bind(this, exitCode));
});
},
SELENIUM_PROMISE_MANAGER: false
};
The problem is that I run same tests on Chrome and Firefox, however in Firefox it errors
Failed: HTTP method not allowed WebDriverError: HTTP method not allowed
And this is the code where it failed
export async function dragAndDrop(el: ElementFinder, target: ElementFinder) {
await browser.actions().mouseMove(el).perform();
await browser.actions().mouseDown().perform();
await browser.actions().mouseMove(target).perform();
return browser.actions().mouseUp().perform();
}
Hi, @gultyaev ! Take a look at https://github.com/angular/protractor/issues/4687 , https://github.com/angular/protractor/issues/4177
@juliemr any solution for this i am also getting same error.
Any solution for the same? for cross-browser with "multicapabilities", the test was working fine with chrome but the browser.actions is failing with firefox, please help.
WebDriverError: HTTP method not allowed
Any update on this? Happening in firefox.
- Failed: HTTP method not allowed
Would greatly appreciate if this got fixed so that we can use firefox with the new dynamic grid https://github.com/SeleniumHQ/docker-selenium#dynamic-grid-
still no fix?
Any help on this bug? Facing this problem using firefox with grid. Failed: HTTP method not allowed
@ashishgoel88 see my comment on SO https://stackoverflow.com/a/66530395/4255158, might help you. It worked for me :)
@WhyINeedToFillUsername Your solution didnt work on mouse actions. I would like to perform right click on the element on firefox. browser.element(by.css('locatorname')).sendKeys(protractor.Button.RIGHT); It does not give any error on this, but also it does not even perform the action. On Chrome, I was able to fix it with the help of w3c config and perform click by using browser.actions.
Thank you for feed back anyways.