I know there is a performance hit when calling a function vs just running the code right there but I was curious how much that would be in different browsers. I went over to one of my favorite JS testing sites, http://jsperf.com/ , and setup a simple test. Running a few tests on a few different browsers suggests that there is about a 50% performance hit when calling a function with a small task.


You can check out the most recent results at http://jsperf.com/function-call-vs-inline and test your own browser.
I LOVE being able to take screenshots of my Selenium tests as they are running!
Here’s how I take screenshots of my selenium tests running, written in Ruby:
Selenium documentation for using the capture screenshot function.
If you are setting up a string in Ruby to then be used in an eval statement in a Selenium test you’ll need some escaping fu to be able to pull it off.
Quotes in strings that are then going to be put in other Ruby strings need to be tripple escaped. If the string is going directly to the eval in Selenium then only a single escape is needed.
first = "first quote: \\\"......"
second = "#{first} second quote: \\\".........."
jsfunction = "window.alert(\"#{second}\")"
puts jsfunction
it "should alert string" do
page.js_eval(jsfunction)
end |

Testing my web development in IE is the bane of my existence. Since I run Apache and MYSQL on my local host on my Mac it was always a trick to view my work though my Windows VM until my friend Mike Farmer showed me an easy way to access my development environment on my Mac from my virtual machine.
Steps:
- Get default gateway of VM machine
- Use that address the same way you would “localhost” on your Mac
Example:

Get IP address of VM

Local Mac development environment

Dev environment from VM