RIDE-Selenium : Patch management with Firefox - 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.

Related

Is there an alternative for `rack-test` for Ruby 3?

We're using rack-test for our Cucumber specs. We've been trying to migrate over to Ruby 3 for a while now and the current issue is that the Cucumber tests crash due to rack-test using both keyword/positional args in their internal methods.
I'm up for patching it myself, but seeing how little activity there is on the repo (including PRs open for weeks/months) I fear that I'd do the work and there would be nobody to patch it.
The only alternatives I see are:
Do the work and pray there will be someone to review/merge the changes
Patch it locally & use the patched version locally from now on (yuck)
Find an alternative solution for rack-test
The last solution seems the best IMO. So, are there any alternatives?
As with all open source software, you have a few options:
Keep using the old software version (i.e. don't use ruby v3.0.0).
Hope that someone else updates the dependencies for you.
Do the update yourself.
Stop using the library.
At the moment, option 1 is totally viable; ruby 2.7 is still actively maintained, and support will probably continue until 2023-03-31. You could do this, simply hoping that option 2 becomes available soon.
The standard practice for option 3 is:
Fork the project, and make the fixes.
Open a pull request to the main repo with your fixes. Hopefully it gets merged.
In the meantime, if you need to be unblocked, reference your forked repo in other projects.
This is clearly more effort, but I wouldn't call it a "yuck" solution; not unless your changes are drastic/introduce compatibility issues with the main project, and the two branches diverge.
As for option 4, as with virtually any library replacement, there's always going to be some trade-off between compatibility/features, but clearly other testing frameworks do exist. It depends how you are actually using it. Your mileage may vary.
In summary, I can't really give an objective answer to such a subjective question, but my advice at the moment would be: If you have time/skill/motivation to update to ruby 3 right now, then fork the dependency and update it. (It's probably not a massive change needed!).
But if you lack the time/skill/motivation to do this, then just stick with ruby 2.7 for now.

Getting Marionette/Geckodriver up and running with Protractor

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 :)

Enabling auto-updates in RubyMine

Is there a way to enable autoupdating in RubyMine? According to this page, you can
Use this page [i.e. "File | Settings | Appearance and Behavior | System Settings | Updates"] to:
Enable automatic update of RubyMine and specify to which kind of release you want it updated.
However, when I actually look at that menu, all I see is this:
Further searching yields no results. Since the page is labelled as "RubyMine 7.1.0 Help", I'd assume that it's up-to-date for 7.1.2, so how can I enable autoupdates? Did they simply forget to update this little chunk of the help documentation?
All of my Google searches turned up absolutely nothing - all the results are about autocompletion or updates in general (i.e. the page I linked at the top) or updating manually or something entirely unrelated in a different IDE or... this question. Huh. Hi, Google!
Note: Yes, it is possible to manually update it from this menu, by clicking Check Now. I'm explicitly not looking for that. I want RubyMine to search for updates and install them on its own, preferably when it starts.
TL;DR version: RubyMine can and will check for updates very regularly, if you select the type of update you'd like.
As far as I know, it will not install it, without asking, but it will automatically check for an update upon starting the app.
Longer version:
First of all 7.1.2 is the most current version of RubyMine, so I wouldn't expect RubyMine to update.
As far as I understand the RubyMine versioning "New Major Releases" means a change in the first number of a version. With that setting you'd get an update information for version 8. If you prefer to get updates more frequently, try one of the other option the Update-Settings provide (see screenshot)
On my machine 7.1.2 installed upon starting RubyMine (but after asking whether I wanted the update to happen). So, it didn't autoinstall without asking for permission.
Currently, Rubymine is in version 2016.1.1b and full transparent auto-update isn't still implemented as far I could see in my Linux (Ubuntu-based distro).
Here, the auto-update is more a auto-detect updates feature, who will ask me to accept the update and let it installs and restart automatically.
Which isn't currently a straightforward method also, because I installed it on /opt and to have right permission to update and it notifies me, I have to call manually rubymine.sh as root and then accept the update - sudo mine won't work.

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.

Resources