I like using Selenium RC for automating interaction with webpages that require JavaScript, except for the fact that it goes through launching an full instance of Firefox to run a script. Questions:
Is there a way to run Selenium RC so that it launches a headless version of Firefox that doesn't create a window? I'm using OS X. I know there is a way to do this using Xvfb on a Linux server, but I'm wondering how this would be done on OS X.
Is there any lighter weight alternative to Selenium RC? The tool would have to execute any JavaScript on a webpage and alter the DOM accordingly. I'm not too familiar with Spidermonkey; but can it be used for this purpose? Thanks.
There's a well supported Java one called HtmlUnit, which is completely headless - there is no GUI. It runs Javascript.
If you don't want to directly call Java, you can in theory run Selenium with HtmlUnit as its backend headlessly - I haven't got it to work yet though.
Also, you might find Selenium 2 better than Selenium RC. It has the WebDriver built in, and looks like it is going to be better and more complete.
Finally, you could run Selenium remotely on your own separate Linux server, and call it from the Mac remotely. Or you can use a service like Sauce Labs.
Related
My solution is using a special way to open a web page: we embedded chrome browser into outlook app.
Now I have to write automation test for it using robotframework.
I tried but selenium cannot detect that browser.
Any ideas are appreciated.
Thanks!
Because Selenium uses the Webdriver to start the browser, automating a browser that is not started using webdriver won't be supported.
Alternatives are to use AutoIT library, that automates your keyboard and mouse actions and focuses on windows. ImageHorizon Library and Sikuli Library use image pattern recognition and support both Windows and Linux.
If your target OS is Windows 10, then Microsoft WinAppDriver maybe of interest. This follows a similar approach as AutoIT, but from Microsoft. Does require the Python Appium application to be installed as well.
All approaches have the pro's and con's and in my view beyond the scope of this question.
Basically I'm going to distribute my Selenium program to a number of clients for automation purposes.
Rather than asking every customer to have FireFox installed (and risking possibly incompatible versions) I would prefer if I could have FireFox (or whatever browser) packaged in my program directory (perhaps a portable version).
All my customers will be using Windows btw.
Anyone tried this or have any suggestions to how this could be accomplished?
EDIT: I suppose I could use PhantomJS with selenium and just package my software with the phantomjs driver. That would not require any external browsers to work, would it?
You have also HTMLUnit headless browser option. Please note that it has own proprietary JavaScript rendering engine so need ensure that your test also will work with the "regular" browsers.
Another option is to use Selenoid and Docker for Windows. Your customers could download easily removable images with browsers (no need to clutter Windows with browser files) and run your test suite in multiple containers in parallel.
I want to write ruby script which run browser (for example, firefox), open web-addresses, click links, check/uncheck boxes and other stuff. What gem can i use for that?
Selenium / Selenium Ruby is another option and there's Selenium IDE for scripting Firefox.
"It is implemented as a Firefox extension, and allows you to record,
edit, and debug tests."
Check watir and watir_webdriver which is used for automated web browser testing but it can be used for browser scripting from ruby http://watir.com/
you can use the rb-appscript framework to automate macosx
http://appscript.sourceforge.net/rb-appscript/index.html
Its a ruby framework that uses the applescript interfaces to interact with the macos applications.
I'm not sure if there is a gem you can use to install yet but there is are install instructions in the link above.
there is a nice article at http://www.apeth.com/rbappscript/00intro.html that shows how to replace applescript with ruby using rb-appscript
Check out watir, watir-webdriver or firewatir. It's very easy to use especially if you're just starting out. You can check out this quick tutorial on how to set it up, it's extremely easy.
http://webmites.org/watir-automated-tests-for-everyone/
I want to compile a portable version of Firefox 3 on a low cost Intel Celeron Windows Xp machine to run as a kiosk computer. So i just want the browsing functionality since i'll be running it on the fullscreen mode. What are the steps to do a minimal rebuild from the sources?
Also what is firefox's command line parameters to open a site from the cmd?
A "Stripped down minimal build" doesn't really make any sense. You can't really exclude any functionality that would make it run faster or be any smaller, since most of the code that Firefox needs to render webpages is the same code that it uses to render its user interface. Forget about trying to "strip down" the code.
That being said, it sounds like you probably want to use XULRunner, which will let you use all the web browsing functionality of Firefox, but wrap it in your own GUI. You can find an ultra-minimalist browser XUL application here:
http://benjamin.smedbergs.us/xulrunner/mybrowser-0.2.2.xulapp
There is a Kiosk mode addon (more for a lock-down) for Firefox.
You may be in general interested in this other question here:
How to lock down Windows XP for use as an internet kiosk?
Here is a gHacks reference for custom builds.
and, a Prism reference.
http://webconverger.com/ provides a minimalistic OS build featuring Firefox. There is also build instructions if you want to build your own customised images.
I have a rake file which runs few tasks. I want to run my tests on several browsers without hard-coding it on each test. Any suggestions would be great.
Have you considered using Watir? It provides an abstract interface to browsers for testing including interfaces to Internet Explorer (by default), Firefox (firewatir), Chrome (ChromeWatir) and Safari (SafariWatir) - IE only on Windows (obviously) and Safari only on OS X (I'm not sure, I don't think they've made it work with Safari for Windows).
You basically make either a method or a class which takes the browser and the URI you want to load and loads them using the relevant Watir classes. Then you create Rake tasks which call the relevant method. The advantage of this is you aren't having to work out where Firefox is, and call it differently if it's running or not.
I haven't done any Watir stuff for a while - I'm moved to Celerity/Culerity for browser testing - but even if you aren't using it for testing, you should be able to use it for launching browsers from Ruby across at least Windows and Mac, and possibly Linux too.
I guess the best way would be to traverse the filesystem based on your current OS and finding the executables of the browsers you want.
Maybe you can take the Launchy code and make it do what you want? :)
http://copiousfreetime.rubyforge.org/launchy/
Launchy is helper class for launching cross-platform applications in a fire and forget
manner.
Currently only launching a browser is supported.
Launchy.open("http://www.ruby-lang.org/")
On OS X, this works for me:
`open #{url}`