简体   繁体   中英

Specify a default product for new SWTBot Eclipse run configurations

I'm developing an Eclipse RCP application and running automated GUI tests using SWTBot. When I want to run a test from within Eclipse I right click on the test method (or class), then click "Run As" -> "SWTBot Test". This then runs the test and creates a run configuration.

The problem is that when the run configuration is created for the first time, it always uses the "org.eclipse.sdk.ide" product by default (in the "Main" tab of the run configuration"). This means the test will run the Eclipse IDE product and try to run my SWTBot tests on it. I have to manually edit the run configuration to use my RCP application's product file and run it a second time.

How can I specify a default product to use for all newly-created SWTBot run configurations?

When running the test, bring up the run configuration dialog by choosing "Run as..." In the dialog, under the tab "common", choose to make it a shared run configuration. It will now create a *.launch file in the directory you choose.

Set all other parameters as you which. The next time you want to run the SWTBot test again, you run the launch file instead.

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