I am in the process of converting my existing test scripts that function fine on Firefox 3.6 to work on firefox 4.0. I've noticed a significant number of syntax changes but the one that is plaguing me at the moment is using verify_contains('text').
The same test that functions fine on firefox 3.6 throws the following error on firefox 4.0 when I use the watir-webdriver
test_060contactmgmt(Test_contact_mgmt):
NoMethodError: undefined method `verify_contains' for #.
If this helps any, I ran a gem update and I am using Netbeans IDE 6.9.1.
It looks like that method has been deprecated in watir-webdriver; for more information have a look at this page Comparison with Watir 1.X at GitHub for the project.
You could always extend the class in your own code to include your own version of the method, I have done this to cover some of the missing methods in my test script after converting them from Watir.
Related
Our team maintains a ruby script that must support any ruby >= 1.9.3 (yes, that's a pretty old ruby version but this is something outside our control at the moment). Recently, we added a change that included the verification of a regexp using match? and everything was going well until one of the users reported that the script was exploding for ruby 2.3 with the message:
undefined method `match?' for #<Regexp:0x000000018471e0> (NoMethodError)
Turns out this happens because the match? method is available in ruby >= 2.4.
We have been running ruby -c script.rb with multiple versions of ruby (1.9.3, 2.0.0, 2.1.10, 2.3.7, 2.5.1, 2.6.3, 2.7.4) as part of our test suite and this didn't show up as a syntax error and I suspect it's because the actual syntax is "correct" but the method is simply not available in some versions of ruby. We also tried rubocop, hoping that it could detect these incompatibility issues but it doesn't report any error either.
So, my question is, what's the best way to check for this API compatibility issues between multiple ruby versions?
Running ruby -c with the oldest Ruby you support is a good start, as it will detect if you are trying to use a newer syntax.
For using methods that are new:
Run your tests suite in both the oldest and newest Ruby versions you want to support.
Consider using my backports gem to make it possible to use newer API even on old Rubies. For example, it includes Regexp.match? among the hundreds of backports...
Do you have an automated test suite? If so, you can set up your CI to test against multiple Ruby versions, e.g.:
https://github.com/actions/setup-ruby#usage
(Edit: I see you did mention a test suite, so it sounds like you have a gap in the test coverage, or you're not running the tests against each Ruby version?).
I am new to Ruby Development. Now i am working on ruby test-framework code which was working fine with Ruby-1.8.7
Now i want to upgrade ruby for this framework. I have found that test-unit-1.2.3 is included in Ruby-1.8.7 so i have installed it separately with Ruby-2.4.1.
Currently i am facing method missing issue ["register_autorunner"] with this combination. Because these method have not been used in ruby-1.8.7
Can anyone please tell me other changes needed to make this combination [Ruby-2.4.1 , test-unit-1.2.3] working.
Thanks in advance
You should update to TestUnit 3.x, which will have a higher chance of working with Ruby 2.x. Then you need to figure out the changes between Ruby 1.8.7 and Ruby 2.4.1, and how to fix your existing code, which is most likely broken, even after you have fixed/updated your unit test configuration.
Also, consider a switch to Minitest or Rspec, as they are a lot more popular today, so it will be easier to find examples and supporting tools for them. Minitest is also the default test framework used by Ruby on Rails currently.
References:
https://www.jetbrains.com/research/devecosystem-2017/ruby/
http://guides.rubyonrails.org/v5.1/testing.html
While using Magento 1.9 (I think that's not very important) I've got following errors in IE9:
SCRIPT438: Object doesn't support property or method 'observe'
validation.js, line 98 character 35
This exception points to an Event.observe call, and there are more exceptions like that.
The prototype version is 1.7.0 and it's loading as first script (by the script src) in header element. All the errors occurs in scripts which should be loaded/initialized after the prototype.js.
I'm debugging it for a few hours without results. The problem does not occur in other browsers.
Do you know how to fix that?
Try upgrading to the latest version of Prototype, and see if that solves the issue. There was a lot of work done in IE compatibility during 1.7.3.
I am requiring the date library and I would expect the methods from this library to appear in the code completion list (and hence get the documentation inline). However nothing appears. Why so?
What RubyMine and Ruby version are you using? Please try 4.5 Release Candidate, everything works fine for me in that version
We have a plugin that we use to enable printing and saving from our
app. We instantiate it using tag with all needed attributes,
and then call Save() or Print() method on the document.embeds[0]
object.
This used to work perfectly on Firefox 3.5 and earlier, but it no
longer works in Firefox 3.6. In 3.6, document.embeds[0].Save is null,
that is our custom methods are not defined on this object.
Any idea why this happens, and what has changed in Firefox 3.6 that
causes it? Any idea on how to debug it and find the cause? And most
important, any idea of a workaround that will allow us to access this
methods?
Thanks,
splintor
Got an answer in mozilla.dev.tech.plugins forum - Firefox 3.6 removes support for XPCOM. We will need to change our plugin according to one of the options suggested in the answer.