Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Run SWTBot test in Headless mode. RCP application is not started
Run SWTBot test in Headless mode. RCP application is not started [message #1782656] Tue, 27 February 2018 12:28 Go to next message
Alex Gor is currently offline Alex GorFriend
Messages: 159
Registered: November 2014
Location: Russia
Senior Member

I observe an issue when I try to run SWTBot test suite from command line.
As started info I use this page :

My ant script is
<project name="testsuite" default="run-swtbot-test" basedir=".">
	<property file="${basedir}/"/>
	<property name="temp.workspace" value="${basedir}"/>
	<property name="" value="org.eclipsecon.swtbot.flexprod.rcpgui.automation"/>
	<property name="os" value="win32"/>
	<property name="ws" value="win32"/>
        <property name="arch" value="x86"/>
        <property name="eclipse-home" value="${rcp.gui.home}"/>
        <property name="jvmOption" value="-Djava.util.Arrays.useLegacyMergeSort=true -Duser.language=en -Duser.variant=DE -cp ${rcp.gui.home}/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar org.eclipse.core.launcher.Main -wsurl https://xxxx.xxxx.xxxx:XXXXX/guisrv/services/ -uurl http://xxxx.xxxxx.xxxx/" />

	<property name="library.file" value="${basedir}/library.xml"/>
	<target name="init-suite">
			<fileset dir="${rcp.gui.home}" includes="org*.xml"/>
	<target name="run-swtbot-test" depends="init-suite">
		<ant target="swtbot-test" antfile="${library.file}" dir="${rcp.gui.home}">
			<property name="testApplication" value="com.tsystems.ths.flexprod.rcp.application"/>
			<property name="data-dir" value="${temp.workspace}"/>
			<property name="plugin-name" value="${}"/>
			<property name="classname" value="org.eclipsecon.swtbot.flexprod.rcpgui.automation.administration.Create2TemplatesWithuniqueMatno" />
			<property name="vmargs" value=" -Xms512M -Xmx512M -XX:MaxPermSize=256M ${jvmOption}" />
	<target name="cleanup"/>

The issue is :
- the script started ,
- the initiating of eclipse platform started,

RCP application, that should be tested, not started. The following error message is saved in log

!ENTRY org.eclipse.osgi 4 0 2018-02-22 19:31:06.741
!MESSAGE Anwendungsfehler
java.lang.RuntimeException: Die Anwendung {0} konnte nicht in der Registry gefunden werden. The verf√ľgbaren Anwendungen sind: com.tsystems.ths.flexprod.rcp.application, org.eclipse.ant.core.antRunner,,,,, org.eclipse.update.core.standaloneUpdate, org.eclipse.update.core.siteOptimizer, com.tsystems.ths.administration.application, Com.tsystems.ths.exporter.application, com.tsystems.ths.flexprod.rdqs.application, com.tsystems.ths.imp.application, com.tsystems.ths.ipp.application, com.tsystems.ths.mdac.application, com.tsystems.ths.monitoring.application, com.tsystems.ths.productionmonitoring.application, com.tsystems.ths.tasklist.application
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.eclipse.equinox.launcher.Main.invokeFramework(
	at org.eclipse.equinox.launcher.Main.basicRun(
	at org.eclipse.equinox.launcher.Main.main(
	at org.eclipse.core.launcher.Main.main(

As I understood this message. Build cannot find Application ID of Application that should be started. Actually the application with id com.tsystems.ths.flexprod.rcp.application should be run. This ID is passed by script but not found by eclipse platform. We can see this application id in list of possible application id.

Could you please help me to resolve this issue?

Also second question is : on page that mentioned above I found that SWTBot headless test execution is not tested under Windows. Is this piece of information correct right now, or not ?

[Updated on: Tue, 27 February 2018 12:57]

Report message to a moderator

Re: Run SWTBot test in Headless mode. RCP application is not started [message #1782750 is a reply to message #1782656] Wed, 28 February 2018 22:18 Go to previous messageGo to next message
Patrick Tasse is currently offline Patrick TasseFriend
Messages: 82
Registered: July 2009
Hi Alex,

I'm not familiar with running SWTBot with ant, but about the application id, it appears that the error message string was not translated properly in German, the binding {0} was probably single-quoted as '{0}' which escapes the binding, it should be double-quoted as ''{0}'' or "{0}", or not quoted at all.

Try removing the user.variant=DE to see if you can get the correct missing application id?

Re: Run SWTBot test in Headless mode. RCP application is not started [message #1797589 is a reply to message #1782750] Fri, 02 November 2018 11:43 Go to previous message
Alex Gor is currently offline Alex GorFriend
Messages: 159
Registered: November 2014
Location: Russia
Senior Member
Hello All

For running SWTBot test we use the following technic.

We have a set of properties that are loaded by ant before test
formatter - is a class that responsible for creating updating test report
testPluginName is name of plugin where test cases and framework are located.
application.root - path to application under testing location${application.root}/config/workspace

cmd.common=-Xms512m -Xmx512m -Djava.util.Arrays.useLegacyMergeSort=true -DPLUGIN_PATH= -cp ${application.root}/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar org.eclipse.core.launcher.Main  -application ${} -testPluginName ${} formatter=${cmd.formatter1} formatter=${cmd.formatter2} -testApplication ${} -data ${} -os win32 -ws win32 -arch x86_64 -consoleLog -debug -clean -console localhost:8811

we run suite via ${cmd.common} -className ${cmd.suite.core}

so in ant we have
<exec spawn="false" executable="cmd">
            <arg value="/c"/>
            <arg value="${}"/>

Where cmd.suite.core - name of JUnit testsuite class

Main idea is we don't start application under testing itself. We start special SWTBot application. (${}

[Updated on: Fri, 02 November 2018 11:44]

Report message to a moderator

Previous Topic:Unable to read SWTBotBrowser text content < Photon
Next Topic:SWTBot in headless mode and java.lang.ExceptionInInitializerError
Goto Forum:

Current Time: Thu Jun 08 23:09:24 GMT 2023

Powered by FUDForum. Page generated in 0.02210 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top