# Basic using Eggplant questions and Tips

Member
I am new to using Eggplant and have the following questions:

1. How to capture image with many pull down menu. For example,
click on Start -? All Programs -> Accessories -> Communications ->
Remote desktop connection

2. How to capture all information from a window that provides a sliding
bar? I will need to drag the sliding bar to the bottom to see
information.

3. In the Eggplant movie, it indicates put a tab after type in the login
name. Does it mean to put a tab key or type the word "tab" in the
script?

4. How to capture a large data in a window that requires to move both
right and bottom slide bars? How to compare the all data in the
window?

5. Any other source to find the tips.

Your inputs and help are greatly appreciated.

Thank you,

Shawn

• Member
1. The easiest way I find to launch a program usually is just entering the path to the exe in the run window. But if you want to click your way through the program menu just take a picture of the start button then all programs etc... and click each picture until you get to the desired location.

2. Yes you will have to slide the scrollbar. Eggplant will only see the information on the screen.

3. Both will work
example
TypeText "user" & tab
or
TypeText "user\t"
These will both tab to the next location after entering the text user

4. Using really large pictures with Eggplant in my opinion can cause problems with finding the image so it is better to break a large image up into smaller ones which makes doctoring the images much easier and faster. You will just have to use eggplant to move the sliders into the appropriate locations and then capture the image. You can also look into Text Image Generation for pictures with lots of text and just search for the text.

5. Definitely look at this forum and the Eggplant and Sensetalk reference manuals located on the testplant site.

Hope this helps.
• Member
I will echo what Jeff said, and add a couple of things:

1. Jeff's right, the best way to launch an app is to open up the run window:
typeText WindowsKey, "r"
typeText "c:\\path\\to\executable.exe", ENTER

Note that I used two backslashes instead of one. This is because you need to escape the backslash.

If you need to navigate the Start menu, you will need to capture an image for each item. Don't capture more area than you absolutely need to get a match. The larger the image, the more chance you will get no matching image. You could also use keystrokes if you didn't want to capture all the images.

2. What are you trying to capture as "data" from a window? If you simple need to see what's at the bottom of the text area, you can do:
repeat until imageFound("ending_image")
typeText PageDown
end repeat


3. Jeff is correct, TAB is a keyword, or you can use "\t" inside a string.

4. Again, Jeff is right on the mark. I strongly recommend either using a text image (Look at Using Eggplant Chapter 2 in the documentation), or scrolling the window and using the smallest image possible for matching.

5. This forum, the documentation available in the Help menu, and email to testplant support are the best places to go to for help and tips.

Hope this helps
Allen
• Member
• Member
Please provide me your feedback why the code didn't pop up an error or stop for entering the timestamp. I must miss something.

Start Time |_____________________|

Moveto "Start Time Field"
Type Text Time & tab

Thank you
• Member
Ok im a little confused on what you are trying to do with the code but here is what I think is the problem.

First off if it is a text field you will have to give it focus to type text into it so use click instead of Moveto because it just moves the mouse to that location but does not click it. Also TypeText has no space in between. Also there are a variety of time formats and formatting you can apply to times in Eggplant using sensetalk just look at the reference manual for these. the long time displays like this 03:39:09 PM

So try this

set starttime to the long time //or just a hardcoded time

Click "Start Time Field"
TypeText starttime & tab

or even TypeText the long time & tab

Hope that helps.
• Member
Thank you for the inputs. I greatly appreciated it. I am getting there. But I still have two problems. First, the cursor (hot Spot) doesn't start at the beginning of the box.

I watched the demo movie. It hightlights the name filed then moves and click the hot spot to the box. The name field is still hightlighted. Yet, When I click on the box, the hightlight area also moved.

Attached is the snapshot of timesthanp I tried to work on. Here is the scenario:

1. I hightlight the time field and click the box. But the hightlight moves to the box.

2. Then I hightlight the time field including the box and do the command-Click.

3. I do the command-Text Data and enter the time field as 2009-04-01 00:00:00:000000 to overwrite the original time shown in the box.

Here is what I enter in the script:

1. Click "Start Time Field"
2. Wait 2
3. TypeText "2009-04-01 00:00:00:000000"

The problem is that the time field is displayed as 2009-04-19 2009-04-01

Second problem - I try to run the selected script but I encounter eror shown at the earlier step. For example, I want to run selected steps from step 22 to step 26. Then, the system displays step 6 has an error.
I only can run it through but can't only run selected steps.

• Member
I review the Reference Manual for the capture area, the hot spot and debug selection. Then, It works now. I just need to dig in and spend more time in the reference manual.

Thank you for all your feedback.
• Member
How do I make a group of scripts or a function of scripts? For example, the first group is for the start up, the second group is for running applications and the third group is to clean up and exit the applications.
Thus, each group can be resed later by other suite to calling it.

Thanks!
• Member
Well if you have them all in the same suite as different scripts then you can just make a new script in the suite to run them in the proper order.

so the run script would be

run "startupscript"
run "applicationscript"
run "closeapplicationscript"

You can also do this with any helpers you have linked to that suite and call the scripts in the helper suite the same way so this would be the solution for you so you can keep your reusable scripts and functions in a helper suite linked to your scripts.

Also if you have a script with a function in it and want to call that function you just do it like this. This works for the helpers as well.

"scriptname".Functionname(params if needed)
• Member
During the automated script run, an image (OK button) can't be found. I recreated it, it seems OK since it goes to next screen. Yet, when running the script again, it fails again.

How to prevent the image shows at the wrong location? Where can I find the document for eggplant setup and lesson learned information.

Also, the view monitor (17 inches monitor) with eggplant debug on yet the SUT with VNC use 19 inches monitor. How do I accomdate this issue since sometime the view monitor can't see the submenu of the application running from the SUT?

Any suggestions?

Thanks!
edited January 2010
Did you set the OK button image to use the Text search type? Not Text Image Generation, but the Text search type. Also, if you have captured the whole button, including the edges of the button, you should recapture it using just the middle of the button (without the button border). The button may be getting rendered with the text shifted left or right by a pixel or two relative to the button border from one run to the next.

How is the image showing up in the wrong location? Is it showing up in one place and then moving as the page is rendered? Or is it just that Eggplant says that it is finding something where it doesn't appear to be? This is a case where you might want to post a screenshot, the image you are looking for, and where Eggplant seems to find the image.

Much of the information in the Using Eggplant guide can be considered "best practices".

I'm not clear if the monitor difference is a problem for you while creating scripts or while running them. If you just can't see the whole screen while scripting, try using the "Scale to Fit" option to have Eggplant scale the remote screen to fit the Remote Screen Window -- this won't affect your images at all. If something is off the screen when you run your script, you'll need to do an "if not imageFound()" statement and scroll until you find it.
• Member
Thanks a bunch for your feedback. I'll try to save the OK button using Text instead of Image, and also only capture the word instead of whold button.

I have the following questions, please shed some lights:

1. How a View monitor with Eggplant to view the SUT which uses two monitors? If I use the option "fit to window", the view window is so small to view and capture images? Do I need to have two View monitors for Eggplant to work properly? The VNC is set up in user mode.

2. How a View monitor to capture three other SUTs that have total six monitors? The VNC will be set up as service mode. Any other setting I need to concern and where is the document to describe this?

Thanks!
1. How a View monitor with Eggplant to view the SUT which uses two monitors? If I use the option "fit to window", the view window is so small to view and capture images? Do I need to have two View monitors for Eggplant to work properly? The VNC is set up in user mode.
This is going to be dependent on your VNC server. Some VNC servers can treat multiple monitors as a single big screen and Eggplant will see it as such. You'll probably have to live with scrolling around that screen to get to things, because, yes, fit to window will likely make things too small to be usable. If your system treats the monitors as separate desktop sessions, you might also have the possibility of configuring a VNC server for each monitor, in which case your script would need to handle switching between them as needed.
2. How a View monitor to capture three other SUTs that have total six monitors? The VNC will be set up as service mode. Any other setting I need to concern and where is the document to describe this?
The discussion above will apply to each SUT, then you'll just have to switch the connection between the SUTs via the Connect command.
• Member
I encountered a problem where I can't drag a line to a lower position. Therefore, the top window can have big area to display information.

The scripts are shown below:

Click "the line"
Drag "the line"
Drop "the line"

I ran these scripts in debug mode. I didn't see the line being pull down.

drag "the line"