Is there a recommended "best practice" for using T

Hey gang,

I’m trying to do something like this:

TypeText “5”, tab, “3”, tab, “MyFile.txt”, tab, tab, tab, tab, “17”, tab, “No”, tab, “144.3”, tab, “No”, tab, “2009”
Click “btnProcessData”

Generally, this is a sequence of keystrokes to enter various data in various fields, then process it. The SUT has the tab index set up for fast data entry by the user.

Timing is a problem because often the button “btnProcessData” gets clicked before all the keystrokes have been fully processed by the SUT, resulting in incorrect results.

I can set the RemoteWorkInterval to something slower, and that works okay. I can also put each TypeText on its own line, and that works too, but doesn’t seem as elegant.

Is there a recommendation or “best practice” on how many commands to put on a single TypeText line?

It seems like the RemoteWorkInterval value drives the speed at which the Click gets sent to the SUT following the TypeText line, and not necessarily how fast each keystroke and tab on the long TypeText line gets sent.

This isn’t really a problem, more of a post to discuss how everyone handles long TypeText commands and the (almost guaranteed) timing problems.

Thanks!
-Dennis

To me it sounds like it is more the program or web page that you are testing that can’t handle all the key entries that fast. Eggplant won’t do the click until it knows that the previous line has been run and sent to the SUT.

I think there are several ways to deal with this.

You could easily do this. Which is what I usually do. I am currently testing a flash app and this is a problem for me.
TypeText “text”
Wait 2 Seconds
Click “Button”

The RemoteWorkInterval is definitely a good way as well but I use the same eggplant license to test various applicaitons so adjusting these to cater to one project can slow things down for other scripts I have.

I have also noticed that tabbing through menus quickly can be problematic for me so I just created a little script to slow things down with out editing eggplant preferences so that the application on the SUT can keep up.

something simple like this can be modified to deal with multiple keys in a array or try changing the preferences --> Run options --> Keyboard --> Next Key Delay

set keys to (" ",“Sample.txt”, " " etc…)
repeat with each item of keys times
Wait 0.5 Seconds
TypeText it
end repeat

I believe that RAM on the SUT will play a part in this also and the number of apps that are running on the SUT or the app you are testing if it is CPU intensive.

Often it is helpful to mimic how a human user would fill in a page, for two reasons:

  1. It will slow down the data entry a little, most likely eliminating the timing issue you are experiencing.

  2. It will ensure that the right data is entered into the correct field. (If the tab order on the data entry page changes, or the SUT is having a performance issue, the script could enter the wrong information into a field, or get “off course” in other ways.)

To do so, put a few validation points in the script which will ensure that the script is doing the right thing at the right location. For example, a human user would validate a label before typing into its text-entry field, and would wait for the system to catch up if there is some visible way of determining that it is not yet ready (perhaps fields are highlighted when ready?). This can reduce risk and increase reliability tremendously. It’s also a little easier to update (or troubleshoot) the script later.

Of course, if you are performance testing speedy data entry, then you could argue that the script is finding the right problem and no adjustments are necessary. Hope this helps.