3 questions before starting to evaluate Eggplant

Hi,

I read as much as I could in the site & forum (didn't get to the manuals yet, though) and I have 3 questions, please:

1. After installing Eggplant on the MAC - can I use that same installation to execute test scripts on BOTH the local MAC machine (on which Eggplant is installed) and on other remote machines, using VNC?
Or - is it a different setup for a Single Machine setup vs. Multiple Machines setup?


2. I understand that Eggplant can easily test when a certain image is expected to appear. But how can it test that a certain image (i.e. palette, window, toolbar) closes/disappears from th application after a certain action? (for example: test that a certain design application palette closes when unselecting it from the Tools/Window menu)?

I found this post from last year:
http://www.redstonesoftware.com/phpBB2/viewtopic.php?t=438&highlight=disappear
Is this answer also answers this question of mine, or is there a better solution now?


3. In my tested application there can be a screen with multiple buttons with the same caption. For example: A screen that displays a list of users, and next to each user there's an 'Edit' tiny-button & a 'Delete' tiny-button.
Since capturing the button image will result in the same image for all buttons on the screen - how can I make Eggplant click the specific button I need, next to the relevant tested user entry?


Thanks,
Karin.

Comments

  • ToddTodd Member
    Hello Karin,

    Great questions, and here goes with answers:

    1. You can test OSX virtual users with the OS X's Fast User Switch feature. This works exactly the same as connecting to and testing a separate system.
      - Create a second user account on the Mac OS X system. - Use the FUS to login to that account. - Launch the Vine VNC Server from that account (you can set it up in preferences to launch automatically and hide on login for that account). - Name the VNC connection something useful (eg. SUT-1). - Switch back to the Eggplant development user account with FUS feature, and you should see the newly minted user account visible as a connection option via the OS X Bonjour services. [/list:u] If not, switch back and restart the Vine Server in your SUT-1 account with Preferences -> Sharing -> Advertise server via Bonjour ... to true. 2. You can check for the absense of an image...
    wait until not ImageFound(imageName)
    

    3. You can use:
    set searchrectangle to ((x1,y1), (x2,y2))
    

    to limit your search rectangles on a SUT screen.


    Cheers,
  • Hi Karin!
    Karin wrote:
    Hi,

    I read as much as I could in the site & forum (didn't get to the manuals yet, though) and I have 3 questions, please:

    1. After installing Eggplant on the MAC - can I use that same installation to execute test scripts on BOTH the local MAC machine (on which Eggplant is installed) and on other remote machines, using VNC?
    Or - is it a different setup for a Single Machine setup vs. Multiple Machines setup?

    The setup is the same, you just use a secondary user account on your local mac to test on the local mac. You can have any number of remote machines, including other macs using VNC. The procedure for connection is the same.
    2. I understand that Eggplant can easily test when a certain image is expected to appear. But how can it test that a certain image (i.e. palette, window, toolbar) closes/disappears from th application after a certain action? (for example: test that a certain design application palette closes when unselecting it from the Tools/Window menu)?

    Yes you can. You can say something like:
    if not imageFound("myimage") then put "pass" into results
    

    3. In my tested application there can be a screen with multiple buttons with the same caption. For example: A screen that displays a list of users, and next to each user there's an 'Edit' tiny-button & a 'Delete' tiny-button.
    Since capturing the button image will result in the same image for all buttons on the screen - how can I make Eggplant click the specific button I need, next to the relevant tested user entry?

    You can do this by adjusting the hotspot, or collecting a set of images that include a little bit more information and click based on that.

    Also, if you run into trouble, those of us that hang out out here will be happy to help.

    Hope you decide to evaluate it. It's way cool, and by far one of my favorite tools in my testing arsenal.
  • KarinKarin Member
    Ok, thank you both.

    Just one clarification regarding #3:
    Todd said I can use the code of: set searchrectangle to ((x1,y1), (x2,y2))
    to limit my search rectangles on a SUT screen.

    Is there another code that I can use for retrieving the coordinates of a certain image on the screen (like: my user's name), so I can use these coordinates as a reference for setting the x & y parameters for the "set searchrectangle" command?
  • Yep You could do:
    if imageFound(topImage) then
                put foundImageLocation() into coordinate1
             end if
             if imageFound(bottomImage) then
                put foundImageLocation() into coordinate2
             end if
    set searchRectangle to (coordinate1,coordinate2)
    
  • JonathanOSXJonathanOSX ForumAdmin admin
    No problem, to get the coordinates of the top leftmost version of an image on screen at any particular point in time you can use

    put ImageLocation("MyImage")

    If it's on the screen multiple times you can get them all as a list with

    put EveryImageLocation("MyImage")
  • KarinKarin Member
    Great. Thanks again.

    I'm still reading the manuals, but there's one basic thing I'm probably failing to understand:

    Can one Eggplant Script run on different types of SUTs (i.e. MAC, XP), or must I prepare separated scripts for each SUT?

    Assume that my application is very much "alike" on each SUT, and there's no major positioning issues, and I use as many Text Images as possible.
    Can I only prepare a set of needed Captured Images for each SUT and a set of "script setup parameter" (like: Text Platform, etc), and then run the same script on these SUTs with these sets?
  • ToddTodd Member
    You will/may have to grab seperate image sets for each application. However if the logic is the same for the test on each app for each platform then the only difference is as you suspected images.

    Utilizing a start/master script for a suite of tests allows you to find out what system, what version of the software is to be tested (maybe more than one version even). Using that information, setting variables, will then allow your scripts to compose the names for the version specific scripts. Or, you could use the OpenSuite command to load a suite which really only contains the image and possibly some script resources pertaining to that particular version of a test. Allen may be able to elaborate on this a bit in his situation.

    Bottomline, not a problem to make a script cross platform in design, and make it a matter of loading images for a particular app, platform and browser version (if it is a web app). Permutations are handled in the code that is generic enough to work with multiple SUTs and apps.
  • This is exactly what we do at MakeMusic. We have a script that wakes our SUT's from screen saver and logs in. Based on the images it finds, it determines what OS we're working on. We store that into a global variable. We then collect all the images for a particular OS into a suite, so for example, all my images for logging in are contained within my SUT startup suite. Then all other images for windows XP are contained in my "XP.suite"

    With all this information, you can then programmatically load and unload suites, to make the images available for a test run. Most of the time, our scripts are logically the same so this is sufficient. If, for some reason, the logic needs to be adjusted (usually because things are waaay different in the UI), we just write a separate function for that piece of the test.'

    Hope this helps!

    Allen
  • KarinKarin Member
    Ok, that's good to know.
    I hope I'll manage to implement that when the time comes :)
    If not - you'll probably hear from me again... 8)

    Thanks for all the answers.
Sign In or Register to comment.