简体   繁体   中英

How can environment variables be specified when launching a Maveryx test application?

Maveryx is an open source test automation framework for testing the user-interface of a Java application. When the framework executes the application under test, it uses an associated launch file. This is an XML file that contains the application launch settings (eg main class, arguments, classpath, JRE …).

It seems to me that there should also be a field where environment variables could be specified. But I have not been able to find such a field in the user manual or online forum.

Is there any way to set environment variables for the application under test.

Note that the variables must not only be accessible to the java application under test itself, but also to any to child processes and native code libraries used by the application (ie via JNI).

I know I can specify environment variables in the command shell that starts the Maveryx test, but I'd rather have Maveryx do it so that it is specific to the test underway and so that the environment variables do not pollute the parent shell.

Thanks!

EDIT: After banging my head against Maveryx for a week or two, I eventually found that it was simply too limited. I discovered that Maveryx is an abstraction layer on top of the abbot Java GUI Test Framework . Abbot itself turned out to be a very flexible and powerful framework that is much more capable and extensible than Maveryx (however there may be some cases where the latter is sufficient). My reccomendation to anyone trying to use Maveryx but encountering limitations, is to check out abbot (and its counterpart test script application, costello).

It is not possible to set the environment variables for the application under test directly in the AUT's launch file (xml).

You can set the environment variables as described here .

Or, programmatically, as in this post . In this case you have set the environment variables in your test script before launching the application under test.

For example:

@BeforeClass
public static void setUpBeforeClass() throws Exception {
     /* set here the env. variables */
}

@Before
public void setUp() throws Exception {
    Bootstrap.startApplication(xmlFile); //launch the AUT
} 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM