i have hard time getting protractor run tests in firefox
following sample test case. can tested in chrome- fails in firefox , 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>
specs file(indexspecs.js)
describe('sample test', function(){ it('change bgcolor red when click 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); }); });
protractor config 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
when set firefox, browser launches - not getting url run test.
your question generic pinpoint rootcause. try answers common issues might have caused problem
update new version of protractor - using 2.0.0 pretty old. using 3.3.0. there more latest version - protractor tried spec , working fine ff-45
coming ie, not sure if have ie driver ,if not run below command
webdriver-manager update --ie
your script might fail in ie throw warning 'active x methods blocked' , may have set ignore option in ie settings before run
Comments
Post a Comment