Tuesday, July 3. 2007
In my previous entry, I described how one could set up selenium to runs tests from emacs, via the Moz REPL. The most painful part of all of that is setting up the REPL to run. After every firefox startup, you have to manually go to tools menu, and manually select 'MozLab' and then 'Start REPL'. YUCK.
Enter UserChrome.js. With a little more polish, some documentation, and something more then a MozillaZine forum posting for a website; this little extension is poised to become the new GreaseMonkey. It will be the GreaseMonkey for the hard core.
Monday, June 25. 2007
Enter Selenium IDE. The Selenium IDE provides you with a method to record and execute automated tests of your website. It is easy to use, and hella cool. It can test things like the existence of an element, the text contained inside of an element, its width, height, position, etc. Using selenium, you can build yourself unit tests. This is especially useful and powerful if you happen to be one of the unlucky bastards faced with writing code in JSTL, SMARTY, or some other templating-language-that-needs-to-die. Now you finally have unit tests.
Using Selenium, the testing process is a little more automated. More importantly, you can build a series of regression tests, to ensure the stability of your web application.
- you can script your browser from emacs
Update 2007-07-09: new versions (Version 0.2) added
Here are the two files:
Here is how you use them:
First, download the MozREPL and Selenium IDE extensions for firefox
Edit selenemacs.el to make sure that the variable selenemacs-js-file points to selenemacs.js
Enable the MozRepl (Tools->MozLab->StartREPL)
Load up selenemacs.el inside emacs (load-file "path/to/selenemacs.el") works
Enable the minor mode selenemacs-minor-mode
Record your test in SeleniumIDE
Use the emacs command selenemacs-execute-test to launch the test, its shortcut is C-c C-s C-e
Emacs tells you if the test passed or failed.
The idea here is that you write your test, and stop using your eyes to test the results of your coding to the browser, but instead use Selenium. This is especially good if you are doing multi-stage and repetitive like testing logins, searches, etc. You can code and test right inside emacs, and only have to switch to the browser to verify that your tests actually passed.
These files also show an interesting way to script mozilla through emacs. The next step of course is to get emacs to start interacting with Firebug.
Friday, March 18. 2005
Tuesday, February 22. 2005
If you got here because this has happened to you, here is a list of things to do:
- Make sure you aren't running 2 firefoxes under a different profile.. Check this post here for some information
- do a search for bookmarks.html on your system. Make sure you DO search hidden files! Open them up with your browser, and if it is your bookmarks, then you are safe. Away you go!
- Do a disk-repair and check. your bookmarks might be in a file called fileXXXX.chk (where XXXX is a 4 digit number, like 0001). What you should do is open the file with a text editor, (notepad if you have to), and you are looking for HTML, with a list of all your bookmarks.. (good luck).
- Use an undelete utility, and look for the file bookmarks.html.moztmp. Apparently that might be your bookmarks file, but it may take some massaging.
- Start backing up! learn from your mistakes. Bookmark Backup is pretty cut and dry, but there are other solutions out there.
- This is bad, this is a very big, bad scary bug with Firefox. But the grass probably isn't all that greener on the other side. IE is still not terribly secure, and, depending on your system, can crash if you even look at it wrong. I don't know about Opera.
- There has been some discussion on bugzilla about this problem, so it will hopefully be addressed and fixed.
Tuesday, February 1. 2005
Firefox tan getting hassled by a mouse-eared tan of some kind
The 'movement' isn't limited to operating systems either, there are also tans for programs as well. Norton Anti-virus and McAffee are represented, but so is Outlook and her mortal enemy Thunderbird. Firefox gets representation as well. Whute!
This is just so damn cool on so many levels. I can't exactly verbalize why I dig this so much.