Having trouble running tests with the protractor in Firefox
Here's a test case that works fine in Chrome, but fails in Firefox and IE browsers.
Sample 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>
Specs File (indexspecs.js)
describe('sample test', function(){
it('change background color to red when button is clicked', 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);
});
});
Protractor 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
Firefox Version - 45
IE Version - 11
While using Firefox as the browser option, the browser opens but doesn't navigate to the URL to run the test.