Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » SWTBot cannot be found by <my-test-plugin> in headless (Running SWTBot test on existing application)
SWTBot cannot be found by <my-test-plugin> in headless [message #1851005] Thu, 24 March 2022 12:27
Uday Kumar is currently offline Uday KumarFriend
Messages: 2
Registered: September 2018
Junior Member
Hi,

I am trying to Automate SWTBot test for my existing eclipse application by following the https://wiki.eclipse.org/SWTBot/Automate_test_execution#Executing tutorial test are not running.

I followed the above tutorial as mention:

In order to run test from command-line, here is the generic process:

Install SWTBot in the application you want to test (this works)
Install your tests into the application you want to test (this works)
Running the test on the application (this doesn't work)


Here is the command-line argument I am using:

java \
 -Xms256M -Xmx2048M \
 -jar plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar \
 -application org.eclipse.swtbot.eclipse.junit.headless.swtbottestapplication \
 -product com.openedge.pdt.core.product \
 -testApplication org.eclipse.ui.ide.workbench \
 -data C:/Work/Worksapaces/12.6/dm-tests1 \
 -testPluginName com.openedge.pdt.core.tests \
 formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,C:/Work/Temp/eclipse-422/eclipse/report/AllTests.xml \
 formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter \
 -className com.openedge.pdt.core.tests.SampleTest \
 -os win32 -ws win32 -arch x86_64 \
 -consoleLog -debug


This give the below error:

Testcase: initializationError took 0.016 sec
        Caused an ERROR
LSWTBot;
java.lang.NoClassDefFoundError: LSWTBot;
        at java.base/java.lang.Class.getDeclaredFields0(Native Method)
        at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3062)
        at java.base/java.lang.Class.getDeclaredFields(Class.java:2249)
        at org.eclipse.swtbot.eclipse.junit.headless.EclipseTestRunner.getTest(EclipseTestRunner.java:261)
        at org.eclipse.swtbot.eclipse.junit.headless.EclipseTestRunner.<init>(EclipseTestRunner.java:224)
        at org.eclipse.swtbot.eclipse.junit.headless.EclipseTestRunner.run(EclipseTestRunner.java:208)
        at org.eclipse.swtbot.eclipse.junit.headless.UITestApplication.runTests(UITestApplication.java:122)
        at org.eclipse.e4.ui.internal.workbench.swt.E4Testable.lambda$0(E4Testable.java:76)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: SWTBot cannot be found by com.openedge.pdt.core.tests_12.6.0.00
        at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:516)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:511)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:403)
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)


It seems SWTBot class is not found by my test plugin, but com.openedge.pdt.core.tests have all the required dependencies in its MANIFEST.
Please suggest, what I am missing

Thanks in advance!
Previous Topic:How to test the Workspace launcher dialog
Next Topic:Test class not found when run from command line
Goto Forum:
  


Current Time: Tue Jul 23 16:07:57 GMT 2024

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

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

Back to the top