OS X part of the book
gb
5 posts
|
Please tell me the OS X part of this book doesn’t use some sort of applescript bridge/apple event type of thing….:( |
Ian Dees
29 posts
|
Hi, gb.
I hear ya. For me, AppleScript has been much more of an adventure to write than to read. Finding just the right combination of To answer your question, you don’t need to write any AppleScript to use the examples in the OS X chapter. The technique uses a bridge under the hood, but you’re writing Ruby. And I don’t mean one big
That’s exactly the approach the book recommends. Whether the underlying technology is AppleScript or Win32 API calls or what have you, the important thing is that you’re building up the language toward your application. So instead of that
There’s one chapter specifically on OS X testing, but the entire first half of the book builds up cross-platform tests that run on OS X. All that material on writing clear test language is applicable, no matter which GUI library is doing the heavy lifting underneath. You won’t need to know AppleScript syntax per se. You’ll be coding to the System Events API, but all in Ruby. A bit like the way Web apps use the RMagick library as a wrapper around ImageMagick, without needing to contain any C code themselves. |
gb
5 posts
|
Sounds like this book is what I’m hoping for ! I’ll be digging into this soon. |
Conrad Winch...
1 post
|
hmmm, before people flame me, I would like to say that I own a lot of pragmattic progammer books, but I just felt compelled to send this email to the support desk Hi, I am a long standing purchaser of pragmatic programmer books and have recently taken to buying betas online. I was very excited to see that “Scripted GUI programming with Ruby’ is now available as a beta PDF because it is described as ‘If you need to automatically test a user interface, this book is for you. Whether it’s Windows, Mac OS X, Java-based or a web app, you’ll see how to test it reliably and repeatably.’ I use macs exclusively and so am extremely disappointed to discover that out of a 182 pages only 10 are about testing on the mac (in a tagged on chapter near the end called ‘One Last Thing: Testing on the mac’). This chapter is also more about applescript than ruby as far as I can tell. The book is essentially a windows only book and therefore useless to me. I am therefore asking for a refund. Please let me know when this has been put through. Conrad Winchester I’m a bit lost as to ‘First half of the book builds up cross platform tests that run on OS X’. Pages 20-86 (the first big example) are entirely windows (with a tiny bit of JRuby/Swing for ‘cross platform’ purposes erhm) only. I have never used JRuby and don’t want to test swing apps (swing??? lol – who uses that any more?). I would like to test either cocoa or flash (air/flex or whatever) applications on my mac – this book is useless for that. There’s a bit on we testing, but thats not really anything new, and then its back to windows with (as I said above) only 10 pages explicitly about testing on a mac. I am so disappointed. |
Ian Dees
29 posts
|
Hi, Conrad. I’m sorry to disappoint. :-/ As you and gb have observed, there is only one chapter that’s Mac-only, as a jumping-off point to OS X testing. I’d hesitate to characterize the book as Windows-only, though. Only one chapter (Chapter 7) is limited to Windows readers (well, and a short appendix). The point of doing an extended desktop example over the first half, and giving equal treatment to both Windows and the JVM, is to quickly transcend the platform-specific calls and get to the test language. Testing a Cocoa app uses the same principles: you start with the accessibility API (which is far simpler than Win32, and requires fewer pages to introduce), and build a DSL for your app. |
gb
5 posts
|
Just bought this. OK so at first glance it seems a bit thin like most of the tutorials out there. It uses text edit and I suppose on OSX people can automate the @*%# out of text edit. Assisted Testing on OSX is hurting unless you like convoluted applescript. I’ve tried rb-appscript which seems to be the only alternative . Active development on RubyOSA seems infrequent at best. Wonder if any one could write a book on doing some real challenging stuff with these ruby drivers. I’d have more faith if I could see something like a drawing program automated. Not just itunes and textedit. with that being said. I still commend you on writing a book on GUI scripting at all and automated scripting/assisted testing. Not many resources on the subject. Out side of really expensive solutions there is little information. I’ve used eggplant I like it but it’s expensive and you learn a language that does you no good elsewhere. Kind of like applescript. Which is why I wanted to learn ruby or python and would prefer ruby to python. forg logi squish is interesting but is python only or javascript and OH yeah expensive. Automator is powerful but still a toy and a pain if what you want doesn’t exist. The one thing that is handy I guess is the watch me do. I’ll dig into this book and see what I learn hopefully I can get a little closer. Also would like to encourage a podcast on the subject like the ruby object model and meta programming I’d pay 5 bucks for a few podcasts on OSX GUI scripting. hint hint |
Ian Dees
29 posts
|
Hi, gb. I agree with you that it would be fun to take on a bigger OS X app. What kind of program did you have in mind? Give me a shout (undees at gmail), and let’s kick a couple of ideas around. —Ian |
7 posts, 3 voices
