Slashdot Mirror


Automatic Functional Testing for Mac and Linux?

testYourGUIS asks: "I work with a company that tests consumer and business software for various venues. One of the programs we rely on heavily is called Rational Visual Test, which is a VB-like compiled programming language that works directly with Windows API to simulate mouse clicks, text entry, menu pulldowns, and so on. We use them to stress-test various applications, collect the results, and then send the vendors a spreadsheet showing what we found. Recently, pressure has started to produce the same results on Mac OS X and possibly Linux applications. I was wondering if anyone knew of such software that works on Mac OS X, and how to go about doing this for Linux?"

"For example, a vendor has a database interface, and wants to know how many times we can access a series of records, what the results show (are the right, blank, time out?), and how long it took for the search to take place during various times of the day, and so on. So we emulate one of their data entry people by logging onto the system, putting in some search parameter from a script, and then record what the text (or error message) was when it came back. Yes, we could connect directly to the SQL database without their front end, but it's the combination of their front end and the database we usually test. We have found many examples where were can connect raw, for instance, but the front end displays a timeout. We also test things like 'What happens if the user enters a colon or asterisk?' or 'What if the text entered in the box is over 256k?' Then we tell the vendor the results, and they hopefully fix them based on the data we gave them."

50 of 200 comments (clear)

  1. AppleScript by krog · · Score: 3, Informative

    you can do this with AppleScript, quite possibly the most underrated language of its kind.

    1. Re:AppleScript by Ioldanach · · Score: 2
      Can applescript handle running 1000 concurrent users from a desktop machine simulating 1000 concurrent users hitting the server?

      What he needs is a load test and functional test product similar to Rational's, but cross-platform. I'd suggest looking into Mercury Interactive's software, though I'm not sure just how cross-platform it is.

    2. Re:AppleScript by scrod · · Score: 2, Informative

      Actually no, that wouldn't do him any good. He would still have to implement the scripting commands in his program. He wants something to simulate the use of the actual interface, not call the underlying functions.

    3. Re:AppleScript by DLWormwood · · Score: 2, Informative

      This assumes that the application being tested is fully scriptable. This requires a factored application design and/or an object model to convert AppleScript commands into their corresponding events. Historically, Mac OS development tools don't automatically create apps with such a structure. And as another poster noted, the means to have AS work with non-scriptable apps requires the use of unreliable "osaxen" that make timing and reliablity metrics meaningless.

      --
      Those who complain about affect & effect on /. should be disemvoweled
    4. Re:AppleScript by guttentag · · Score: 3, Informative
      How about QuicKeys? When I couldn't get AppleScript to translate spoken commands into certain keystrokes and mouse clicks in my mapping program, I found that QuicKeys was able to do the job. (I ended up using AppleScript for the Speech Recognition input and QK to manipulate the interface)

      Someone mentioned server load testing earlier... if that's what you're looking for, remember that Mac OS X is basically a pretty window manager on top of a flavor of FreeBSD -- you can have cron automate shell scripts and perl.

    5. Re:AppleScript by Aqua+OS+X · · Score: 2

      This is what I thought as well, However creating an AppleScript would probably take forever.

      I think this guys best bet is to develop using cocoa and to give a timed public beta to the mac community.

      However, I couldn't hurt to check out Apple's developer connection page as well. There is a -lot- of good info there. Ask some developers at Apple. Moreover, try to ask some developers from the OmniGroup ( http://www.omnigroup.com ). They do a lot of consulting, they are friendly, and they have been developing with NeXT, Rhapsody, and OS X for years.

      --
      "Things are more moderner than before- bigger, and yet smaller- it's computers-- San Dimas High School football RULES!"
    6. Re:AppleScript by phillymjs · · Score: 2

      While certainly not a suitable answer to for the guy who Asked Slashdot, AppleScript is fantastic. How the hell is it cumbersome, painful, and unreliable?

      If you can read and write English, you can become a pretty decent AppleScripter in a few hours. Pick up a decent book on it, and you'll be making your Mac do backflips in a few days.

      I've used AppleScript to write a CGI that duplicates the functionality of Outlook Web Access with Microsoft Entourage.

      I also make extensive use of it in my web-based control system for my home automation rig-- hell, AppleScript is the BACKBONE of my home automation rig, gluing together various apps.

      In about 20 minutes one day, I wrote a script to strip out the stupid, extraneous shit from "CNN Breaking News" e-mails, create a new message with nothing but the actual news item in it, and send it along to my cell phone.

      One of my clients (a huge, multi-national food company whose products are mm mm good) uses two AppleScript CGIs that I wrote for searching job archives they have on their internal web site.

      Sure, sometimes I've had to write a small 'test' script on the side to help myself understand how to extract a particular data item from a record, but it's a relatively painless process.

      Whenever you have trouble with a scriptable app not made by Apple, blame that app's vendor for not doing a good enough job at making it scriptable, DON'T blame AppleScript.

      ~Philly

  2. testing tools by Anonymous Coward · · Score: 5, Informative

    try OpenSTA. Its an open source automated testing application, similar to Rational's product.

    www.opensta.org

    There is a commercial company that provides support at www.opensta.com

    1. Re:testing tools by leandrod · · Score: 3, Informative

      For all I could gather OpenSTA is still MSW32-only, with plans to porting to other platforms; and it can't yet do tests other than http yet.

      IANATester.

      --
      Leandro Guimarães Faria Corcete DUTRA
      DA, DBA, SysAdmin, Data Modeller
      GNU Project, Debian GNU/Lin
  3. Hmm. by dasmegabyte · · Score: 5, Informative

    Automatically uses the API to interact with the machine? Yeah, they've got this for Mac...it's called AppleScript and it's been around for roughly 20 years.

    Don't be scared by the name "script"...there are visual tools for ascript and the language itself is so simple my mom could do it.

    --
    Hey freaks: now you're ju
  4. XRunner by micantos · · Score: 5, Informative

    Check this out for some pretty reasonable X-windows testing. Heard quite a few positive things about it.

  5. Java... sort of by d3xt3r · · Score: 4, Insightful
    Are these applications you need to demo like this, Java Swing apps? If so, you can use built-in javax APIs to do this. You could simulate user actions this way, mouse movements, etc as a "demo" mode for the user.

    Obviously this would work on Linux, OS X, and Windows as well.

    Hope this helps.

    1. Re:Java... sort of by Evil+Pete · · Score: 2

      At work here I suggested as a product that was in beta, on the basis that it looked interesting and "why not give it a shot" and the other recommendations were so expensive. And the guys in testing got a trial copy and have been very happy with it, though I haven't used it myself. It is qftest from Quality Software First. We build our java stuff for Win2K , Linux and Solaris. And this seems to do the job well. And its dirt cheap compared to anything from Rational or Mercury where you've gotta shell out big time.

      --
      Bitter and proud of it.
  6. Re:In case it gets slashdotted by yorgo · · Score: 5, Informative

    Check out http://www.testingfaqs.org for a short list of possible contenders (GUI test drivers).

  7. Legos! by djtack · · Score: 5, Funny

    I've got it... you need Lego Mindstorms. Just build some robotics to push the mouse around, whack random keys, etc. Best of all, such a system would be fully platform-independant. I bet Microsoft is already doing this, only they call it "genetic programming".

  8. We're working on one... by matticus · · Score: 3, Informative

    Actually, the company I am currently employed by is in the process of writing a system/gui test environment for this very purpose. One caveat-it's only for Java, but when we complete it (very soon), we will release it to the public. our address is www.atomicobject.com.
    The name of the project will be HASTE, look for it in a month or two.

    1. Re:We're working on one... by spicysquid · · Score: 2, Informative

      you can get system.out stream and write out the character sequences to that byte if it is a terminal/telnet program. For swing programs, you can just fire off actionevents to take care of the items.

  9. XTest and Expect ? by too_bad · · Score: 4, Informative
    Isnt this what XTest and
    Expect allows us to do on Linux
    (and a vareity of other operating systems) ?

    --
    DO NOT PANIC
    1. Re:XTest and Expect ? by Vee+Schade · · Score: 2, Informative

      XTest must be compiled into X as an extension and appears only to allow "fake key presses" which will probably not be very useful in this context. Expect allows for "automating interactive processes" (and is VERY good at it - IMHO), where such processes are CLI-driven (e.g. telnet, ftp, etc.), and so is also not useful in this context.

      --
      "LinuX - Dropping the c u r t a i n on Windoze." -- Vee Schade, vschade at mindless dot com
    2. Re:XTest and Expect ? by cduffy · · Score: 4, Informative

      Actually, android lets you script fake keypresses, mouse events and such from a TCL interpreter (which expect happens to be). However, it doesn't let you see and check widget contents as text in the same way that many of the Windows-based test systems do. The commercial products for X suffer from similar failings when not using explicitly supported widget sets; as such, automated testing is just one of those things that isn't so well supported under X Windows. Hopefully Berlin (or some other successor) will help in this.

      (FWIW, my job very recently involved buying or writing an automated test scaffold for graphical apps on Linux that would work across architectures and windowing systems -- it turned out that the latter was necessary, as the available commercial products just weren't/aren't cross-platform capable, and android has some serious faults which I'll expound on if asked. The product partially exists, having been put on hold for other internal development... perhaps when it's finished we'll release it under an open license).

  10. Automatic Functional Testing for Mac and Linux? by jay_in_pa · · Score: 2, Insightful

    You might be able to use Rational Visual Test with a windows based X-server to control Linux (or any Unix) apps.

  11. xnee by tompa · · Score: 3, Interesting
    Don't know about OS X, but here is an excellent GPL'ed event recorder/playback app for X Windows: xnee.sourceforge.net

    you could always port it to OS X ... :-)

    /tc

  12. Check out Test Quest Pro by Jay · · Score: 3, Informative

    It's a PC you can use to drive keyboard / mouse input into another system. It comes with a video capture card to read the output and make decisions about whether the test was successful or not.

    It's fully scriptable using a c-ish syntax, and comes with a nice IDE and runtime environment to get the work done. It seems like it may be a nice match for what you want to do.

    Here is more info.

    --
    You think emacs is evil?! You've never used VM's XEDIT have you?!! That's evil, baby!
  13. I've got two words for you... by pi_rules · · Score: 5, Funny

    Trained Monkeys.

    1. Re:I've got two words for you... by RandomCoil · · Score: 2

      Actually, depending on the application, you may want "untrained" monkeys. "Trained" monkeys might not provide a reasonable simulation of your end-users. :)

      You might also look into pigeons.

  14. All you need is a cat by hipnotik · · Score: 2, Funny

    Let a cat in the room and pretend you are doing some serious work.

    1. Re:All you need is a cat by b1t+r0t · · Score: 2

      So what do you do when Accounting asks you about all those purchase orders for catnip?

      --

      --
      "Open source is good." - Steve Jobs
      "Open source is evil." - Microsoft
  15. Expect by Prof_Dagoski · · Score: 2

    Here's a website that talks about the language: http://expect.nist.gov/. I bet there's other sites so check google. O'Reiley also has a book about it. I still think I'd use Applescript under MacOS, but under Linux I'd give expect a try. I played with it a little under Solaris and it looked pretty useful. I was able to automate the setup for US Robotics modem racks and Cabletron ethernet hubs using expect. Never did get that stuff totally debugged and my script would go crazy, but that's not the language's fault.

    1. Re:Expect by mikeee · · Score: 2

      Well, all you need to do is run X over aalib and you can automate it with expect just fine... :)

  16. Re:Here's a good automatic functional test by dkh2 · · Score: 2, Insightful
    "The more functional an OS, the more desktops it has."

    Yeah, right. That paraphases exactly why we've used VHS for 20+ years instead of Beta. NOT! It is arguable that the Apple was a superior computing platform to the IBM PC of its day. The IBM-PC had the full corporate power and marketing strength of, well, IBM behind it while the Apple had the comparatively limited resources of two guys named Steve.

    For the uninformed... Back in the days when the VCR was just being released on the world there were two competing formats, JVC's VHS format (which we all know) and Sony's Beta (a.k.a BetaMax). The latter was far superior but, alas, was first out marketed (a bit of history), then out litigated (Read case story). To date the majority of video production houses still use Beta because of it's superior image and audio quality.

    --
    My office has been taken over by iPod people.
  17. For Mac OS X... by Chops-Frozen-Water · · Score: 2

    You could probably roll your own rather quickly with the CGRemoteOperation API: /System/Library/Frameworks/ApplicationServices.fra mework/Frameworks/CoreGraphics.framework/Headers/C GRemoteOperation.h

    --
    The Future: Some assembly required; batteries not included.
  18. F-Script by Tomy · · Score: 3, Informative

    For Mac OS X have a look at F-Script. You can inspect a running program and call any method in that program and any method on any object in the Objective-C runtime. This should allow you to generate events or enter text in text fields, etc.

    Of course this will only work for programs developed using Cocoa. Can't help you with Carbon apps. You might be able to write something using the Apple Event manager.

    Last time I had to do this for Linux (and Gtk+) I had to roll my own.

  19. Robot and BeanShell by Joseph+Vigneau · · Score: 2, Interesting

    I'm assuming you're talking about java.awt.Robot. This, with BeanShell would allow test scripts for GUIs to be built.. A more sophisticated system would be able to capture AWT events, and store them in a file for later playback...

  20. Slashdot math is at it again by spacefrog · · Score: 2, Funny

    it's called AppleScript and it's been around for roughly 20 years.

    Let's see here... 1993-2002 is roughly 20 years?

    Has CowboyNeal been teaching you "new math"?

    1. Re:Slashdot math is at it again by zulux · · Score: 3, Funny

      Let's see here... 1993-2002 is roughly 20 years?

      It is if you're using base 5 - due to a tragic accident involving penut-butter, weasels, and a large bowling-ball; and thus only have one hand.

      --

      Moneyed corporations, non-working 'poor' and criminal prisoners are turning productive citizens into tax-slaves.

  21. Funny by psocccer · · Score: 3, Interesting

    I just posted a set of tools for automating X at my website that I recently created to make a bot that could play Yahoo! Spelldown. There are 2 parts to the tools, finding things on screen using a "visual grep" program that finds images inside of images, and xte, an app built on the XTest extension that allows scripting of moving the mouse, clicking, dragging, keypresses, etc. Together you can use them to make scripts that can identify buttons on screen or letter or words or numbers, whatever, and interact with programs. Still a pre-1.0 version, but it does everything listed above so far.

    BTW, don't use xse, which is a wrapper for XSendEvent, if you roll your own. There are so many places where it just doesn't work, or doesn't work right, because the XSendEvent function just doesn't work reliably. I lost a lot of sleep over that before I gave up and just wrote xte.

  22. QARun, QADirector? by edrugtrader · · Score: 2

    i think compuware's QARun or QADirector work on *nix

    --
    MARIJUANA, SHROOMS, X: ONLINE?! - E
    1. Re:QARun, QADirector? by KaiserSoze · · Score: 3, Informative

      Holy piss, madd scientist, I can't believe you recommended that ;)

      QADirector is not a testing language in itself. It is a harness from which to run the script generated by script writers. It used to be a Unix app, but when the switch was made to Wintel there were a few missteps. If you are looking for a test harness that is comprehensive (for Windows anyways) in its command-line options, look into QAD, otherwise I would go with Test Director by Mercury or maybe Segue's new product (I believe its called SilkPlan or something similar).

      QARun on the other hand is a pain in the ass. If you are looking for automation, don't use it. It's designed for straight-up "record and playback" style testing. If you wish to deploy these tests to client machines (something which some, but not all people want to do), do not use QARun. You can look into XRunner (it is the predecessor of WinRunner) by Mercury if it is still being sold/supported for *nix testing. I honestly don't know about Mac, our product doesn't run on it.

      If you want a serious evaluation document, I highly suggest heading over to http://www.qaforums.com and head to the Automation section. Post a query about the Mac and you'll probably receive a response from one of the moderators with a white paper that was written comparing all of the available tools.

      DISCLAIMER: My group uses QARun, QAD, Segue Silktest, and WinRunner, so as not to be accused of bias.

      --

      "What we elect to call imagination is mere combination of things not heretofore combined." - Frank Norris

  23. Rational Software and Linux don't mix by tuxlove · · Score: 2, Interesting

    Over the years I've asked Rational salespeople if they plan on porting some of their more popular debugging tools to Linux, such as Purify, Pure Coverage, Quantify, etc. The earliest responses to the question were, "What's Linux?" In later years, the response has simply been "No". I do not understand why, but it has been a major sticking point for me. More and more, people are developing software for Linux, and it's hard to understand why companies like Rational won't embrace it.

    I'll tell you, it's a major hassle to develop a product for Linux while being forced to debug it on Solaris because that's the only place our debug tools will run. The first company to make decent Linux tools that are similar to Rational's will have my business. And Rational won't.

    1. Re:Rational Software and Linux don't mix by Tony+Hoyle · · Score: 2

      Rational haven't even ported (properly) their products to VS.NET yet... their 'VS.NET compatible' version of Purify is just an external app that you have to call up and load your EXE in, which sucks hard.

      I'm not impressed with their testing software - we paid for Rational Robot (£20,000 - something like 6 months software budget for a small company like ours) and a programmer has been trying to work out how to use it for another 6 months. It still can't test reliably. For that time/money we could have just had the programmer actually doing the damned testing themselves.

  24. Applescript, QuicKeys for Mac OS X and OSA by plsuh · · Score: 5, Informative

    AppleScript is great, but the app that you are testing must be scriptable. Many are today, but some are not. Furthermore, in this situation you want to test the GUI, not just the underlying object model which is what AppleScript talks to.

    However, AppleScript is not the only scripting environment for the Mac. Underlying all of the native scripting languages on the Mac is something called the Open Scripting Architecture. This allows any OSA component (i.e. scripting language) to talk to any other OSA component.

    One OSA component is QuicKeys, a great product that actually does simulate mouse clicks, keystrokes, etc., and is completely scriptable. It integrates completely with AppleScript and via the power of the OSA, with shell scripts and Perl as well.

    On top of this, Apple provides a powerful GUI building tool for AppleScript called AppleScript Studio, which is free. Plus, AppleScripts can talk across a network to do RPC. Imagine, you can have an AppleScript Studio front end that drives scripts on a set of machines over the network (so that you can assess performance under load). The individual scripts rely on AppleScript to drive the logic while using QuicKeys sequences to drive the GUI.

    The only issue here is how easily you can assess results. There's no general way to check what the GUI is showing other than a pair of Mark I mod 0 eyeballs, since grabbing data out of the app being tested (even simulating a copy-paste) only talks to the underlying data structures and does not address GUI bugs. A possible way is to arrange the windows in a known manner, turn off the menu bar clock, take a screen shot, and use a graphical comparison tool to XOR the bitmap with a known good screen shot to highlight differences, but this won't work if you're working with variable or randomly generated data.

    Disclaimer: I work for Apple, but these are my opinions only and do not represent any sort of official endorsement.

    --Paul

  25. DejaGnu and friends by eyepeepackets · · Score: 2

    DejaGnu is a TCL/Expect testing harness provided as free software by the Gnu Project. Not sure if it has tk hooks (which would allow you to test X-based programs) so you might want to check. If you're trying to test programs on the postscript display of a Mac instead of X, well, I don't know if it would work. Also, check to be sure there is a recent version of TCL/TK and Expect for your machine before you pursue this too far.

    There is also LTP, the Linux Test Project, which may be of use to you as well. (Do a Google search for "linux test" and you'll find it quick.)

    If you're not a TCL programmer, you're probably not going to like DejaGnu very much. If this is the case, good luck with the GUI tool search; you can expect to spend some serious money for decent test tools. (The pun is simply there. If you look at it too long or pay too much attention to it, it may or may not vanish. Just chalk it up to some crazy cat and don't worry about it.)

    Best wishes,

    --
    Everything in the Universe sucks: It's the law!
  26. Android by DumbSwede · · Score: 2
    Expect and Xtest have already been mentioned.
    Android runs on top of these and can be downloaded free for Linux and Unix

    See the July 2001 issue of "Dr. Dobb's Journal"
    for an overview of Android and how to download.

    Plays back keyboard and mouse events for most UNIX implementations. (maybe even Mac OS X)
    It is a little bit roll-your-own
    Expect to spend some time writing perl to support your android scripts.

  27. Re:Couldn't you use PERL? to do a lot? by selan · · Score: 2
    Rational Visual Test(or Irrational Test as we often refer to it.)

    <g> IIRC, it's called Visual Test because it used to be Microsoft Visual Test and was bundled with Visual Studio. Then they sold it (back?) to Rational.

  28. WinRunner by jishak · · Score: 2, Informative

    My company uses WinRunner for Windows GUI testing. I know that Mercury Interactive which makes WinRunner and LoadRunner another GUI Testing utility creates Unix version of their software in addition to the Windows versions. I don't know about Mac though.
    Mercury Interactive
    Hope that helps
    Joe

  29. ATK for GTK+ apps. by TrixX · · Score: 2

    I'm not completely sure about this, but I think you can use ATK (accessability toolkit) for sending events and getting widget contents to GTK apps. That works only onn GTK2, though, so perhaps it's not helpful to you, but at least I think the functionality is there.

  30. AppleScript doesn't do what he wants by Trepidity · · Score: 2

    AppleScript interfaces directly with the program at a lower level than the GUI -- it's essentially an alternate method of controlling the app, plugging into the same API as the GUI widgets do. This tests the app and everything below that, but it's not exactly the same as actually testing through the GUI itself, since you're bypassing it.

    1. Re:AppleScript doesn't do what he wants by Arker · · Score: 2

      Actually I believe it does have calls to do UI-level actions - mouse clicks for instance.

      --
      =-=-=-=-=-=-=-=-=-=-=-=-=-=-
      Friends don't let friends enable ecmascript.
  31. Re:Slashdot math is at it again"Think Different" by t0qer · · Score: 2

    No this is what apple means to
    "Think Different" :P

    --toq

  32. Re:Here is a possible solution by pete-classic · · Score: 2

    I don't have moderator points, so I'll just post at 2 below this ;-)

    You could roll your own based on VNC by creating your own VNC client that generates it's own scriptable mouse and keyboard events.

    Then just run the standard server on the tested system.

    -Peter