[quote=“Ai Choo Khoo”]This means that if my test is designed to run on different platforms (e.g. Windows, Linux), then I have to define 2 sets of textStyle. For example, I write sth like this in my script, is it?
if OSType = "Win" then
click (Text:"File", TextStyle:"WinMenuStyle")
else
click (Text:"File", TextStyle:"LinuxMenuStyle")
endif
[/quote]
You could do it that way, but the TextPlatform mechanism is designed to make this much simpler. Basically, you define a text platform for each system and define matching text styles for each platform. So in this case you’d have a “Windows” platform and a “Linux” platform, and define a “Menu” style for each platform.
To use this approach, somewhere near the beginning of your script you would select the text platform for the system that you’re testing:
if OSType = "Win" then
set the CurrentTextPlatform to "Windows"
else
set the CurrentTextPlatform to "Linux"
endif
Once the CurrentTextPlatform has been set, any text styles you use will take their definition from that platform (as configured through the Text section of Eggplant’s Preferences). So you can simply say:
click (Text:"File", TextStyle:"Menu")
[quote=“Ai Choo Khoo”]How about TIG? I’ve to run 2 TIGs on Windows and Linux platforms respectively?
According to Using Eggplant manual (under Text Image Generators), the native TIG platform can support Mac and Windows XP. I have set it to Native and run my application on Windows XP platform (without running TIG server on my run machine), Eggplant failed to detect the text image that I have defined. It only works when I changed to Host and switched my desktop appearance to Window Classic style. I’m just wondering whether there is a way to run the Windows TIG server downloaded from Eggplant to identified text image in Windows XP style. Please advice.
[/quote]
For each text platform that you define in Preferences, you specify the generator that it will use. The Native generator uses the Mac’s native text rendering engine, and should be used only when scripting against another Mac. For Windows text you must run the Windows TIG on the SUT. New in Eggplant 4.1 is a Pango generator (available as a separately downloaded bundle) that runs within Eggplant but generates text that can be used with many Linux applications (and some on Windows as well).
I hope that helps to clarify the situation.