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: 132
Registered: November 2014
Location: Russia
Senior Member
–°olleagues


I observe an issue when I try to run SWTBot test suite from command line.
As started info I use this page : https://wiki.eclipse.org/SWTBot/Automate_test_execution#With_Ant_or_Command-Line

My ant script is
<project name="testsuite" default="run-swtbot-test" basedir=".">
	<property file="${basedir}/build.properties"/>
	<property name="temp.workspace" value="${basedir}"/>
	<property name="plugin.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.country=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">
		<tstamp/>
		<delete>
			<fileset dir="${rcp.gui.home}" includes="org*.xml"/>
		</delete>
	</target>
	<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="${plugin.name}"/>
			<property name="classname" value="org.eclipsecon.swtbot.flexprod.rcpgui.automation.administration.Create2TemplatesWithuniqueMatno" />
			<property name="vmargs" value=" -Xms512M -Xmx512M -XX:MaxPermSize=256M ${jvmOption}" />
		</ant>
	</target>
	<target name="cleanup"/>
</project>


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

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
!STACK 1
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.equinox.app.error, org.eclipse.help.base.infocenterApplication, org.eclipse.help.base.helpApplication, org.eclipse.help.base.indexTool, 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.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:248)
	at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
	at org.eclipse.core.launcher.Main.main(Main.java:34)


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: 56
Registered: July 2009
Member
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?

Patrick
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: 132
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
Where
formatter - is a class that responsible for creating updating test report
testPluginName is name of plugin where test cases and framework are located. 

bundle.name=xx.xxx.xxxx.pluginName
application.root - path to application under testing location
cmd.ws=${application.root}/config/workspace
cmd.app=org.eclipse.swtbot.eclipse.junit.headless.swtbottestapplication


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 ${cmd.app} -testPluginName ${bundle.name} formatter=${cmd.formatter1} formatter=${cmd.formatter2} -testApplication ${bundle.name} -data ${cmd.ws} -os win32 -ws win32 -arch x86_64 -consoleLog -debug -clean -console localhost:8811


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


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

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. (${cmd.app}

[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: Wed Nov 21 04:30:13 GMT 2018

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

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

Back to the top