How to capture text?

Hello,

While automationg our product we came across to some needs of text capturing and keyboard command to be executed on screen, to describe the problems are as follows:
As a part of automation, we need to know if Eggplant is able to capture text at places let say some list item or label which are populated dynamically. To elaborate this, let us take example:
There is a list box for fruit name which gets populated with fruit names dynamically and during execution we need to know which fruit name has been selected, using image capture it is difficult to handle, so is there any way to capture list item on run time as text? which is offerd by most of the automation tools.
Secondly, while on run time we wish to execute a keyboard command to select some menu item, let say Alt + F, is there any way offered by eggplant?
Thirdly if what is the syntax of Switch cases.

Thankyou

No, there’s no way to do this easily with Eggplant. As you note, object level tools can get this information directly from interface objects, but Eggplant does not currently have access to this information.

While we hope to address this issue at some future date, I generally feel that this notion of “dynamic” data in tests is blown out of proportion. It seems that in most cases you can reuse the same data on each run – the application can still dynamically generate a popup list and it only takes a couple of minutes to capture the associated images. As with other Eggplant tests, this approach guarantees not only that the object knows about the elements in the list, but also that they are being properly displayed. That said, I do recognize that there are some instances where data truly is dynamic and tests need to be written to deal with it, so we will continue to pursue solutions to allow Eggplant to handle these situations more gracefully.

Secondly, while on run time we wish to execute a keyboard command to select some menu item, let say Alt + F, is there any way offered by eggplant?

You can send Alt+F with the following command:

TypeText WindowsAltDown, "F", WindowsAltUp

See pages 138 & 139 of the Eggplant Reference for a complete list of modifier key codes.

Thirdly if what is the syntax of Switch cases.

SenseTalk doesn’t have a switch statement. You can use if…elsif to do pretty much what a switch statement does.

Regards,
Matt