browser.actions()._ HTTP method not allowed
See original GitHub issueBug 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();
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Protractor : HTTP method not allowed - angular - Stack Overflow
I am just pressing the ESC button that's it, there is not GET or PUT OR ... requests I am doing here.. angular...
Read more >405 Method Not Allowed - HTTP - MDN Web Docs
The HyperText Transfer Protocol (HTTP) 405 Method Not Allowed response status code indicates that the server knows the request method, ...
Read more >How to Fix the HTTP 405 Method Not Allowed Error - Kinsta®
It's an HTTP response status code that indicates that the request method is known by the server but is not supported by the...
Read more >How to Fix HTTP Error 405 Method Not Allowed - Hostinger
When a website shows the 405 Method Not Allowed notification, it indicates a Hypertext Transfer Protocol (HTTP) error.
Read more >405 Method Not Allowed - KeyCDN Support
The 405 Method Not Allowed error is an HTTP response status that tells you that a web browser has made a request to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
@ashishgoel88 see my comment on SO https://stackoverflow.com/a/66530395/4255158, might help you. It worked for me 😃