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.

browser.actions()._ HTTP method not allowed

See original GitHub issue

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();
}

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:6
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ashishgoel88commented, Mar 24, 2021

@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.

0reactions
WhyINeedToFillUsernamecommented, Mar 22, 2021

@ashishgoel88 see my comment on SO https://stackoverflow.com/a/66530395/4255158, might help you. It worked for me 😃

Read more comments on GitHub >

github_iconTop 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 >

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