Eggplant FAQ

Contained here are the Redstone Software Official Eggplant Frequently Asked Questions (FAQs), things folks ask often and need to know quickly while using Eggplant.

Q: Will Eggplant run natively on Apple Intel?
A: As of release 3.0 (30-May-2006), Eggplant and all other Redstone Software packages are built as full Universal Binaries. This means all software from Redstone is currently being run and tested against all Apple Supported hardware (currently PPC and Intel).

Q: Can Eggplant be used to move files to/from the SUT?
A:
Absolutely, to and from a client. Just select the item you want do copy, and control-click/right-click on the item. "Copy ", and move the cursor to the destination desktop. Right click, “Paste Item”, and presto VNC/Vine does the work for you. No FTP, no DCC, no fuss.[/b]

Q: When using Vine Server I get no support for AZERTY?
A:
VNC Client software will work in whatever emulation/mapping mode the VNC Server is set. The VNC Server needs to be in US 101 mode only, as such Vine Server does not currently support any other keyboard mapping than US 101. Thus AZERTY and other French/Belgium keyboard mappings are not currently supported. However, a proposed solution where a repository of custom mappings may be made available is being considered. For now however, Vine Server emulation supports only the US 101 keyboard mappings.

Q: Why the difference in PPC vs Intel recursion depth limits?
A:
It appears the call depth limitation, which is based on the underlying system architecture, may be less restrictive on Intel machines. Based on preliminary experiments with very simple scripts, we’ve successfully called scripts on Intel hardware to more than 4 times the depth we reached on PowerPC hardware.

If you’re running Eggplant on an Intel-based Mac, please give this a try and see how it works for you. By default, Eggplant’s maximum call depth is set to 13. This number was chosen to allow scripts to fail gracefully with a clear error message before the calls reached a depth that would crash Eggplant. Try increasing the depth on your Intel hardware to 30, by typing the following command in a Terminal window:

defaults write com.redstonesoftware.Eggplant MaxCallDepth 30

Hopefully this will be enough to let your scripts run comfortably, without much danger of crashing.

Q: How can my scripts know if they are called by the runscript CLI?

A: As of Eggplant 3.31 you can use the RunningFromCommandLine() function to determine this.

Q: I’m using two VNC servers on two different SUTs. Eggplant connection windows show one connection with the proper colors, and the other connection is not. What must I do to fix this problem?

http://img404.imageshack.us/img404/2624/nonrfbcompliantvncservefz1.jpg

A: One of your VNC servers is not RFB-Compliant, and is sending the image data in the wrong endiness format. Eggplant 3.3 and beyond offers ‘default’ color mode to communicate with the VNC server on your SUTs in it’s native format. Make sure to switch to default mode when connecting to your non-RFB compliant VNC server, which will force Eggplant to take whatever image data is sent and not try to make it correct per the RFB specification.

Q: I want to run Eggplant tests against Vista, yet its unclear what I must do to get VNC running in the new Vista operating system. What must I do so I may run Eggplant tests against Vista SUT?

A: There is no built in VNC-type remote desktop management in Vista (yet). You must install a VNC server (RealVNC, TightVNC, etc), and have it run in user mode.

It is not recommended by Redstone to bypass security, however if you want to test a Vista machine, it seems this is currently the only way to do it. Proceed at your own risk, and perform due dilligence in your research on the risks involved runnning without Session 0 security on a VNC server in Vista.

Q: How can I run Eggplant Purple and Green for a side by side feature comparison, look and feel.

A: The way our license manager works it will find the Eggplant Purple license first. If you make a copy of the Eggplant application and launch both of them the second one should launch as Green once you install the Eggplant Green key.

This will allow you to do a side by side comparison of the differences.

Q: I’m having little to no problems with Windows TIG and filename matching, however when I change my SUT to OS X, I’m having almost no luck matching text images on the Mac OS X Desktop with the OS X Text Image Generator. The background is set to black. Why am I having no luck with matching on TIG images?

A: The Finder’s Desktop produces some very difficult text to match by rendering document titles with a “Shadow” attribute. Even on a black background this sufficiently changes the text enough to where it can’t reliably be found. We don’t currently expose these attributes to our Text Image Generator engine - although we may in the future.

Usually when working with the Desktop if I want to select a file I’ll just TypeText the appropriate name to select it and then TypeCommand “O” to open it. You can even do a TIG validation checkstep at this point (since the shadow attribute goes away once it’s selected).

Hopefully that helps work around the problem for now and we’ll consider the feature request for shadow attributes in a future version of Eggplant.

Q: I have a macpro quad xeon with a big 30" cinema display, able to handle loads of colors, for a SUT. I’m able to connect to it with Millions of Colors, but not reliably with 256. Why is this a problem?

A: The best solution to this problem is to not configure your SUT Vine Server to 256 colors, but always allow it to dynamically be told what configuration the VNC Client (in this case the Vine Viewer) wants its screen data sent. So, if at all possible, always configure the Vine Server for millions of colors, and in the Eggplant (VNC client) connection panel create a new connection with the transmission data set to 256 colors.

Q: I’ll be utilizing Excel spreadsheet file data mounted online via NFS and other remote file system mount points as well as local files transfered via FTP and copied from emails. How can I read the Excel spreadsheet data, and also open the files named within the Excel spreadsheets?

A: There are two ways to read data from an Excel spreadsheet in your Eggplant script. The first is to export the data from Excel into a text file and then read the text file. You’ll probably need to use that approach if the Excel file is on another machine, particularly if it’s not on a Mac.

The other way is to use AppleScript to access the data from a spreadsheet on the Mac where Eggplant is running (it should also be possible to read from another Mac on the network, but is more complicated). There is an article in the Eggplant Examples forum on our website that describes how to do this using AppleScript:

http://www.redstonesoftware.com/phpBB2/viewtopic.php?t=151

We understand you may be reading the names of data files from your spreadsheet. Once you have a file name, you can read that file directly if the file is either on the Mac where Eggplant is running, or is on a file system that’s mounted locally on the network. To read the entire contents of a file into a variable is as easy as this:

put file theFileName into myVariable

Please see chapter 14 of the SenseTalk Reference manual:

http://www.redstonesoftware.com/docs/manuals/index.html

“Working with Files and File Systems” for more information.

Q: I would like to know what values make the most sense to use in setting up tolerances for image comparisons. What does a tolerance 0 mean compared to that of say 45? And can I set this globally and also override it for individual comparisons?

A: The precise image and standard image tolerances can be set programmatically within your Sensetalk scripts.

set the preciseImageTolerance to 5
set the standardImageTolerance to 45

Default values are 5 and 45 respectively. A lower tolerance means a closer match must occur. Specifically if you have a pixel with a value of pure black (0,0,0), and a standard image tolerance of 40, then a comparison of say (39,39,39) would match, but a comparison of (41,0,0) would not match.

Q: How does OpenSuite, and Start Using compare.

A: The Eggplant OpenSuite command looks for suites in the following way:

  1. Searches directly relative to any already open suites (for sub-suites)
  2. Searches relative to the current suite’s parent directory.
  3. Searches in the User’s Default Eggplant Document Directory.

If it can’t find a matched name suite to open and use during the calling context, Eggplant will throw an exception. You can trap and handle the exception with the Try … Catch … End Try control structure. After the calling context frame is done, the suite in question is no longer opened, making all its handlers unavailable until reopened with the OpenSuite command again.

The Start Using is a SenseTalk command, identical to the ‘insert object into back’ command. Scripts are inserted into a linear object list, where messages are first handled by the first in script, passed along until handled by each subsequent script. Page 129 of the SenseTalk Reference manual goes into great detail about front-scripts, back-scripts, host application message handling and how this ability can provide a multiple inheritance model.

Q: I have a number of scripts which use the start using and OpenSuite commands of Sensetalk and Eggplant. Why do the scripts work in GUI, but fail during CLI use?

A: If runscript/CLI is being used, and the StartItemContext is also being used:

sudo /usr/libexec/StartupItemContext /Applications/Eggplant.app/runscript

You will need to ensure that your user start up context has settings for Eggplant in the context’s defaults database:

sudo ./StartupItemContext /usr/bin/defaults write com.redstonesoftware.Eggplant DefaultDocumentDirectory "/my/path/to/eggsuites"

This will ensure the ability of your scripts to find other scripts/suites while in a CLI and using a generic user context. This is often the case during evening test runs where nobody is logged into the Eggplant development host and the scripts/suites are run from cron/CronniX.

Q: I’m getting a few log errors in my Eggplant scripts which report a SRUN_BadValue. What does this mean?

A: First, an SRUN_BadValue error occurs when a command, function, or operator is expecting to receive a certain type of value but instead gets something else. For example, this could occur in a place where a point is expected but the value given is not a list of two numbers. This same error code is used to report many different errors of this type, and usually indicates a problem in your script.

Q: I am booting a headless desktop Dual 2GHz PowerPC G5 OSX 10.3.9 with Vine Server 2.1 installed on it and eggplant 3.2.I am using VNC viewer 4.2.1 on my laptop to try and access the Mac. I’m getting small screen resolution defaults, why not the 1024x768 or higher I have set before going headless?

A: The older (G3, G4 and G5) Apple Macintosh PowerPC at times have problems when no monitor is plugged in. Using a video dongle in many cases solves this video problem. Here are some links to how to make a dongle, to modifying existing adapters, and also buying already-made dongles:

If you have the Apple provided DVI<->VGA adapter, that being plugged in at times seems to help avoid no video at all, giving some resolution options like 800x600 and 1024x768. The latter resolution has been adopted as the Redstone Support Labs default resolution and is a very usable solution.

Q: On the VNC server I have tried the to set the port default to 5900 which should have indicated a screen size of 1024x768. I tried Eggplant and Vine Viewer with other port numbers also but this did not affect the screen size. I’m not sure if the port number usually affects the screen size as I have not much experience with VNC. How do port numbers affect the VNC Server and VNC Client screen sizes?

A: Any port number (as long as it doesn’t collide with an already leveraged port #) should work fine, and to our knowledge there is no pratical limit to which port you would use for what resolution. However there are practices in place at different institutions which require port mapping to screen resolution. This is not a limit of Vine Viewer, Vine Server, or the standard VNC/RFB protocol. Use whatever port you want, and whatever resolution you desire, and Eggplant (Vine Viewer) will adjust accordingly automatically for you. The bottomline, screen resolution on the VNC server is completely independent of port numbers.

Q: I have a need to relocate our Eggplant development systems into a secure server room that is not on location or near the Eggplant developers, and no monitors are allowed. How can I do this?

A: At the Redstone Support Labs we have successfully run with Windows as the point of access remotely to a bank of Mac Minis (could be XServers, Desktop Macs) and tested against other macs used to access far away remote web content. Here is the specifics which we have tested and run with great success.

  • PC (win2k/real vnc) <=>
  • Mac Mini Intel Headless (10.4.8/Vine Server/Eggplant) <=>
  • Mac Mini PPC Headless SUT <=>
  • WAN apps on East Coast 2000+ miles away.

We cold boot the minis without any devices connection (no mice, keyboard or video) and autostart to a known state/user account. Then we VNC’ed into the known IP numbers of the Minis (windows Real VNC doesn’t support Bonjour), and all systems come up fine in Real VNC. Then running fairly CPU intensive Eggplant scripts from the EP dev Intel Minis, against other Minis in house and abroad (in other labs). This has worked flawlessly.

Both Intel and PPC minis have installed OS X 10.4.8 coming up with 2 options for video resolution (one of which was default set to 1024x768).

Hotplugging a ViewSonic A75 monitor into both dev and SUT minis resulted in a larger list of resolution options.

I get this question a lot as folks start using Eggplant. Specifically when starting a test suite, and doing web application testing, using a browser (or a variety of browser and platforms) is crucial to the test process. After watching the online web demo video:

http://www.redstonesoftware.com/products/purple/movie/indexQT.html

folks generally have the concept of dev system, SUT, and how to capture and save scripts to rerun later for regression testing or functional testing purposes. Typing text is imperative though in interacting with a browser or having some kind of data driven testing.

http://www.redstonesoftware.com/phpBB2/viewtopic.php?t=567

To set a browser’s URL field, simply grab an image that is guarenteed to be on a browser’s page where the moved hotspot (where the click will occur) will always be in the URL field. Then call the setContentsOfField to set the field’s value. In our case, call the function like this:

SetContentsOfField "URLField", "http://www.redstone.software.com"

Included is an example suite, just unarchive on OS X, drag and drop the SetContentsOfField handler into your own suite. Run the Main.script to see how the example code works with the SetContentsOfField script.