The end goal is to write an automated test in Ruby/Cucumber for connecting to a WebDAV server and testing authentication, CRUD and load/performance in Mac OS X.
I'm trying to simulate user behavior as much as possible which is why I'm looking at rb-appscript, but I'm open to other ideas.
I initially tried this:
app("Finder").open_location("http://example.com/dav")
but that just opens your default browser. I'm guessing open_location
just uses Mac OS' default app based on protocol or extention.
I also tried to simulate a Finder Keyboard shortcut for "Connect to Server...", but that didn't work either:
app("System Events").processes["Finder"].menu_bars[1].menu_bar_items["Go"].menus["Go"].menu_items["Connect to Server..."].click
Any ideas?
Your second solution should work just fine, but replace the "Connect to Server..." with "Connect to Server…". That's the ellipsis character (option-;), not three periods in a row.