Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » swtBot UI tests execution using maven tycho
swtBot UI tests execution using maven tycho [message #1064453] Wed, 19 June 2013 11:08 Go to next message
Deepak Malhotra is currently offline Deepak MalhotraFriend
Messages: 2
Registered: June 2013
Junior Member
Hello,

I have a swtBot test project which has automated tests for my custom eclipse plugin. I was looking for ways to run the tests headlessly and found it can be done with maven tycho.
I configured my swtBot test project with maven tycho to run the swtBot tests headlessly. Refer to the pom.xml which is attached. The maven tycho build was successful for the project but on running the tests I'm seeing the below exception.
Running com.ebay.soa.service.automation.firstTestCase Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.141 sec <<< FA ILURE! com.ebay.soa.service.automation.firstTestCase Time elapsed: 0 sec <<< ERROR! java.lang.IllegalStateException: Could not find a display at org.eclipse.swtbot.swt.finder.utils.SWTUtils.display(SWTUtils.java:25 0) at org.eclipse.swtbot.swt.finder.finders.ControlFinder.(ControlFin der.java:82) at org.eclipse.swtbot.swt.finder.finders.ControlFinder.(ControlFin der.java:72) at org.eclipse.swtbot.swt.finder.SWTBot.(SWTBot.java:115) at org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot.(SWTWorkbench Bot.java:58) at com.ebay.soa.service.automation.firstTestCase.beforeClass(firstTestCa se.java:52) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framework Method.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCal lable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMe thod.java:42) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores. java:27) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.ja va:30) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet. java:62) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTes tSet(AbstractDirectoryTestSuite.java:140) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(Ab stractDirectoryTestSuite.java:127) at org.apache.maven.surefire.Surefire.run(Surefire.java:177) at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSure fireBooter.java:72) at org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.run(Hea dlessTestApplication.java:21) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithEx ception(EclipseAppContainer.java:587) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandl e.java:198) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli cation(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ec lipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:353) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) at org.eclipse.equinox.launcher.Main.run(Main.java:1438) at org.eclipse.equinox.launcher.Main.main(Main.java:1414)


I'm encountering : java.lang.IllegalStateException: Could not find a display exception while test execution. Anybody who encountered this or knows a workaround for the same?
Please let me know if u need more information on tycho configuration or project structure.
  • Attachment: pom.xml.txt
    (Size: 1.27KB, Downloaded 234 times)

[Updated on: Wed, 19 June 2013 11:09]

Report message to a moderator

Re: swtBot UI tests execution using maven tycho [message #1064465 is a reply to message #1064453] Wed, 19 June 2013 12:11 Go to previous message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 865
Registered: July 2009
Location: Grenoble, France
Senior Member

Did you have a look at
http://wiki.eclipse.org/SWTBot/Automate_test_execution#With_Maven_and_Tycho
?
The value of the useUIHarness and useUIThread parameters are critical
for SWTBot usage.

HTH
--
Mickael Istria
JBoss, by Red Hat
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
Previous Topic:Running SWTbot test heedlessly
Next Topic:SWTBot and RAP
Goto Forum:
  


Current Time: Tue Mar 19 08:55:57 GMT 2024

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

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

Back to the top