Thats basically my question. I have searched the internet and I have no idea!
I read in a tutorial (http://www.layeredthoughts.com/automation/how-to-write-your-first-ruby-web-bot-in-watir-scraping-weather-com) that I need to install JSSH for the tutorial to work, but there are no instructions on how to do this and I cannot find anything on the watir homepage.
You do not need to install the JSSH plugin to drive Firefox.
If I recall correctly, the JSSH plugin was needed several years ago - probably back in 2010 when the article you referenced was written. Driving Firefox, as well as Watir, have come a long way since then.
As a result, you should try following a more recent tutorial. Then go back to the article you were reading if there are additional tips you need, but would like need to adjust.
Ċ½eljko Filipin's Watirbook has been frequently updated with steps for installing Selenium-Webdriver on various operating systems for various browsers. Note that Watir is simply an API wrapper around Selenium.
The installation steps are simply (for more explicit details/steps see the book):
Install Ruby
Install selenium-webdriver
Install the watir and watir-webdriver gems (this is not listed in the book, but they are required if you want to use the Watir API instead)
Install Firefox (if it is not already)
That is it. The other plugins (Test-Wise Recorder, Firebug, FireXPath) are not needed. The latter two can be replaced by Firefox's built-in developer tools. The usefulness of recorder is often debated.
Once everything is installed you can start off with a script like:
require 'watir'
browser = Watir::Browser.new :firefox
browser.goto 'http://www.weather.com/
Then you can start working on automating the page.
Related
hello guys i try to learn more about how to create firefox add-ons
by following this article
Getting_Started_with_Firefox_Extensions
but when i try to install the add-on
firefox add-ons manger tell me this could not be verified to use in firefox
i read this article and try give me the same can any one tell me how to avoid this problem
I think you should look into this instead: https://developer.mozilla.org/en-US/Add-ons/SDK the legacy SDK will go away at some point, so better start now using the latest SDK.
When doing that, you will use jpm (https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Getting_Started_%28jpm%29) With which you can test add-ons without installing them (jpm run)
I've taken a look at the Net-SSH gem, but it doesn't seem to support the in browser aspect. Before I start integrating that gem with javascript and a full user interface, I just wanted to ask the community if there are any libraries that have done this for me already. Feel free to suggest libraries outside of ruby. Any and all suggestions welcome.
There is already a product: GateOne. But sorry it is Python.
I recently started using the Dojo firebug extension. I had gotten used to it since it had some nice features (letting you see dojo on the widget level). This was good for me because I am in the process of trying to learn dojo so this really let me see how stuff worked together.
My question is, has anyone found any solutions to get the Dojo firebug extension working in Firefox 6 or should I just try downgrading to FF5?
Thanks
UPDATE:
I tried a workaround I found somewhere else. It said to use the Firefox nightly build add-on, and that add-on would allow me to override the version compatibility. I tried that and it still didn't work.
I recommend trying the Add-on Compatibility Reporter extension from Mozilla. This extension (besides letting you report incompatible add-ons) lets you completely disable version checking.
It's a great way to ensure that older extensions still work when Firefox upgrades the browser every week. Now, this assumes that the issue is with version compatibility, and not that the plugin is actually broken! If it's the latter, there's not much else you can do.
(Also, that's an awesome plugin. I'm definitely going to try it out myself here shortly!)
I've recently started using watir-webdriver and so far am a big fan. However I need to be able to test Safari too, and I don't have access to a mac to be able to use Safari-Watir.
Does anyone know a good alternative to use for testing Safari on a windows machine? (In Ruby of course)
Thanks
(important, see UPDATE below)
the Selenium Webdriver folks are apparently waiting for something from Apple in order to support safari. I would not hold your breath.
Apple does have a version of Safari for the PC, I'm not sure how good the current version is, the initial releases were.. um, well, lets just say they had issues (lots of issues)
Personally (mostly for security reasons) I would not run it nor recommend anyone use it for any purpose other than downloading Chrome or Firefox. But unfortunately a lot of apple users use it because it's what came with their systems, which means to the extent apple users are part of your target market, you have to test on it.
For the moment that means you'll need to use Safariwatir, which has not as far as I can tell had an update for a year or more.
the current state of support on both the Selenium/Webdriver side and the Safariwatir side was discussed recently in this thread in the watir general group on google
UPDATE
Webdriver now has Safari support, which makes direct support of safari (I think on a mac only at this point) possible. See http://watirmelon.com/2012/04/17/using-watir-webdriver-with-safari-at-last/ for more info.. still a bit DYI but I'm sure it will get more accessable soon.
Mike, seems this is available now. Alister Scott wrote up some instructions on his blog Using Watir-Webdriver with Safari At Last
Unfortunately this still a bit DYI because you have to build your own safari extension, which requires getting certificates and such from apple, and I'm not sure if you can create the right environment to build that stuff on anything other than a mac.
I'm building a Ruby program that uses several other programs, and while most of them are programs I can download and run on this computer, one has to be accessed and run through a web browser.
I actually have two questions: I've found Watir which looks like a good web automation tool, but it's meant for testing. Is it still okay to use Watir for automation in the main program, not for testing? Or is there something better out there to use?
The other question I have is that I can't get Watir to work. I downloaded the firewatir-1.6.5 gem and installed jssh for Firefox 3.6, but when I run
b = Watir::Browser.start("the_web_page_address")
it just opens a new Firefox window to Google, and I'm given the error:
Unable to connect to machine : foo.bar.baz.blah on port 9997. Make sure that JSSh is properly installed and Firefox is running with '-jssh' option (Watir::Exception::UnableToStartJSShException)
I've run Firefox with -jssh but that doesn't seem to help.
Watir is perfectly suitable for automating browsing tasks. I've personally used it a couple of times for that purpose. However, you might also want to look at other solutions, such as Selenium.
Now, to be honest, I don't have much to say about your second question;
I'm assuming you've set Watir to open firefox by setting
Watir::Browser.default = 'firefox'
If so, things should be running as normal. Did you restart firefox since installing jssh? Did you install Watir and jssh as instructed on the tutorial?
I can suggest running Watir with Internet Explorer, instead of Firefox, but that might be unsuitable for your application. If all else fails, try the other framework I recommended earlier.
You also might want to check out a headless option. Sometimes it's not necessary to install an automation framework like Watir or Selenium when something simple like mechanize would suffice. Really depends on the complexity of what you're trying to automate!
http://mechanize.rubyforge.org/mechanize/EXAMPLES_rdoc.html