The pusher does not work in Firefox and IE browsers

I find it hard to get protractor to run tests in Firefox

The following is an example of a test case. It can be tested in Chrome, but it does not work in Firefox and IE browsers.

Test file

<html>
    <head>
        <title>automation test</title>
        <style>
            #tst{
                width: 200px;
                height: 200px;
                border: 1px solid;
            }
        </style>        
    </head>
    <body>        
        <div id="tst"></div>
        <button id="clickme">Click me</button>        
        <script>

            document.getElementById('clickme').addEventListener('click', function(e){
                document.getElementById('tst').style.backgroundColor = 'red';
            });

        </script>
    </body>
</html>

Specification File (indexspecs.js)

describe('sample test', function(){

    it('change bgColor to red when click the button', function(){
        browser.driver.get("http://localhost/test/index.html");
        var btn = browser.driver.findElement(by.id('clickme'));
        var clRed = "rgba(255, 0, 0, 1)";
        btn.click();

        expect(browser.driver.findElement(by.id('tst')).getCssValue('background-color')).toEqual(clRed);
    });
});

Configurator configuration file

exports.config = {

    seleniumAddress: 'http://localhost:4444/wd/hub',

    specs: ['indexspecs.js'],

    jasmineNodeOpts: {
        showColors: true
    },

    capabilities: {
//        'browserName': 'internet explorer'
        'browserName': 'firefox'
    }
};

protractor version - 2.0.0 version of Firefox - 45 version of IE - 11

When installed in Firefox, the browser launches - but does not receive a URL to run the test.

+4
source share
2 answers

, root. , .

  • Protractor - 2.0.0, . 3.3.0. - Protractor , FF-45

  • IE, , IE-,

    webdriver-manager --ie

IE script, , "Active X- ", , ignore IE

+1

Selenium . :

https://github.com/angular/protractor/blob/master/docs/referenceConf.js

:

exports.config = {

    seleniumServerJar: 'node_modules/protractor/selenium/selenium-server...',

    specs: ['indexspecs.js'],

    jasmineNodeOpts: {
        showColors: true
        defaultTimeoutInterval:30000
    },

    capabilities: {
        //'browserName': 'internet explorer'
        'browserName': 'firefox'
    }
};

jar

http://www.seleniumhq.org/download/

0

Source: https://habr.com/ru/post/1653389/


All Articles