Getting Marionette/Geckodriver up and running with Protractor - jasmine

So I've been having an issue getting my Protractor/Jasmine tests running in FireFox. I've been aware of the version issue from FireFox that doesn't support selenium angular/bootstrap etc etc and that has been my issue to date.
I was informed to try geckodriver but really can't find any good resources on how to set it up using protractor and jasmine. Or even which driver is the appropriate one to use.
Recently I've tried the following to get FF back up and running (all resulted with no luck):
Downgraded FireFox to as low as 33.x.x while keeping
Protractor/Jasmine at current versions (4.0.5 and 2.51 respectively).
Downgraded Protractor to as low as 3.0.0 while keeping FF at current version (47.0.1)
Downgraded both Protractor and FF to the lowest above versions.
Used Latest Version of FF 47.0.1 with lesser versions of Protractor.
Used Latest Version of FF 47.0.1 with latest version of Protractor 4.0.5
Used directConnect: true and directConnet: false
So I guess now I have one of two questions:
1. Could somebody post a protractor config snippet using the geckodriver / or direct me to a walk-through of this.
2. Inform me of a work around or a working solution (versions of both webdrivers/protractor/jasmine, etc).
If you need to see errors or my config file or anything at all please just simply comment and I'll be happy to revise.

There was a period of time around Firefox v46 and Selenium v2.5x where things were incompatible due to changes to the firefox web-driver. The issues were quickly addressed by the community.
The issue with Protractor lies with the webdriver-manager being a bit out of date with the updates. As per discussions on github, they are aware of this, and a fix is coming.
The workaround in the meantime is to manually update the outdated pieces.
Here's how you'd do it, run
webdriver-manager update
This will give you the paths to all the components the webdriver-manager handles for you.
Navigate to the selenium-server-standalone.jar file (protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar in my case) and replace this with the latest selenium standalone jar (anything v3+ should be good). Make sure to retain the exact filename as the previous jar file. (link: http://www.seleniumhq.org/download/)
Repeat the process to get the latest Gecko web-driver. Uncompress and replace the current version. (link: https://github.com/mozilla/geckodriver/releases)
Now run your tests through protractor and you should be good with the latest version of Firefox.
Good luck and happy testing :)

Related

RIDE-Selenium : Patch management with Firefox

I have firefox 31 in my testing machine and I am using Robot framework to test functionality.
Before I was facing the problem like if I update firefox then my test case fails and then I did some research on it. Finally I found that there is lag between the time release of Firefox version and Selenium updates accordingly.
So now I am confused that to make our testing environment stable with new updates, how to proceed?
What could be the procedure for this Patch of firefox and Selenium library ?
Thank you.
If I understand correctly, updating FireFox causes an issue as sometimes there can be breaking changes, which are not addressed until a later date by Selenium?
If this is the case you have a few options which I imagine you're already aware of:
Don't update until the Selenium update is released, until then, do not try and support something that could break.
Update where you can, if a breaking change has been introduced, rollback and state you don't support that browser version. With this method there's obviously potential for waste.
Update and make changes to the tests in order to get them working for the latest version. You can revert once the Selenium updates are out that address any breaking change.
Personally I would opt for the first option, given it is by far the simplest. However, this may not be an option for you.

Selenium::WebDriver::Error::JavascriptError: arguments[0] is undefined

After seeing that this is a problem with Firefox 35, I installed 34 and ran bundle exec rspec and my tests ran perfectly. But when I tried running it again, it somehow opened the newer version of Firefox as I get the following error again when I run my test suite:
Selenium::WebDriver::Error::JavascriptError: arguments[0] is undefined
Is there a way to guarantee that I don't have Firefox 35 installed that Selenium is somehow finding and opening? I know that Firefox 34 is the version of the Firefox in my Applications directory, but I am not certain there isn't a replica copy of a newer firefox that Selenium is grabbing when launchy is used.
This is a known issue with the current release of selenium.
As #janders223 points out in a comment on another question, the temporary workaround for a Ruby project is to use the dev version of the selenium-webdriver gem.
Modify your Gemfile to specify the latest dev version (as of this writing):
gem 'selenium-webdriver', '>=2.45.0.dev3'
Then run bundle install.
So, this is incredibly basic, but I found that when I had installed Firefox 34 via the dmg listed here, because I had naïvely just dragged and dropped the Firefox icon into the Applications folder clicking "Yes, I would like to overwrite the extant application" I hadn't ensured all of the newer files of Firefox 35 weren't available for Selenium to use, which Selenium availed itself of without me knowing which version it was choosing.
I simply uninstalled Firefox completely from my the mac by dragging it into the Trash, & reinstalled the Firefox 34 dmg.
N.B. Also if you run into this issue, when you download Firefox 34, you have to go to Firefox >Preferences>Advanced , click the Update tab, and choose "Check for updates, but let me choose whether to install them" or "Never check for updates" to prevent Firefox from automatically updating to Firefox 35 and therefore messing with your Selenium test suite the next time you run them again.
This problem also appearing in python selenium package nowdays. it is possible, that "arguments" appearing in code eventually. It can be solved simply by announsing all arguments at start in different var variables.
Approved answer showing this technique.

require-less throwing lessc error in firefox

So I'm working with RequireJS and BackboneJS. I can get everything to work fine in Chrome but when I load up in Firefox I'm getting that lessc is not defined. Obviously pulling out the less files will prevent the error from occurring. Does anyone have any ideas why require is unable to load lessc in firefox but its doing fine in chrome?
Screenshot:
http://screencast.com/t/WenocFdCA0V
Video w/ lessc not being defined in Chrome but not Firefox
http://screencast.com/t/ac96qZrpQb3R
Let me know what other info may be useful.
Thanks in advance!
Seth
less.js is broken, because it uses loadStyles before it defines it, and Firefox stopped hoisting functions according to the spec. There are probably more such mistakes, but this is the first one that is triggered during execution. Please note that the minified version is not affected because of the minification rewriting the code.
less-require is similarly broken, as it contains less.js and therefore contains the same bug.
You might want to replace lessc.js in require-less with the 1.5 beta or master version of less.js to work around this, or wait for upstream to officially release it and require-less to pick it up.
However, it appears that lessc.js is a modified version, so it isn't likely as easy as replacing the file. You would need to merge the changes back.
It might be easier just to move the affected latedefs around until it runs correctly instead of upgrading to a later less.js version.

Add-on support after update

In a previous project I wrote a Firefox extensions - nothing too complex - that used xmpp4moz, an add-on for Firefox that integrates the xmpp/Jabber protocol. At that time Firefox 3.6 most the most recent one and everything worked quite well. Now with Firefox 5 xmpp4moz does produces errors, starting with
Error: Component.classes['#something/something/...'] is undefined
and naturally resulting in further 'undefined' errors. In some sense this is ok, since xmpp4moz is officially not available for Firefox 5. And given that the last update was in 2009 I don't really expect a updated version. Currently I see the following two options:
Looking for alternatives/workarounds/...; so far I haven't found anything. Any ideas?
Trying to update/modify xmpp4moz myself to make it running in Firefox 5
The thing is that at the moment I cannot really assess the required efforts.
Summing up, I'm stuck :)
The sameplace download at http://www.sameplace.cc/ appears to include a slightly newer version of xmpp4moz (I didn't really check whether install.rdf is the only difference from the source code repository however). Still, it is only compatible with Firefox 3.6. From the look of it, there are no big issues, main problem is that the XPCOM components aren't being registered. See https://developer.mozilla.org/en/XPCOM/XPCOM_changes_in_Gecko_2.0 for information on the relevant changes, usually updating the components and chrome.manifest is easy.

Has anyone successfully run a WatiN test against FireFox 4?

It looks like the jssh plugin (required to run WatiN) still needs work going by FireFox Bug 586869, to quote:
Probably obvious to anyone who ought
to be trying to maintain jssh, but, to
get it back all you have to do is "hg
up -r 3ca5d6674feb" and copy it to
wherever you're going to work on it.
Haven't found much recent activity on SO for jssh either.
Firefox + jssh build
WatiN - Support for firefox and chrome
check the links - watin works with firefox latest version after installing mozrepl-jsshv2.6.xpi provided by Fabian
Thanks to Fabian. I hope the Watin and Firewatir community embeds this xpi in their repo

Resources