Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

SOATest Error - webtool.test.TestSuite cannot be cast to webtool.test.ToolTest

Options
Speedy993
Speedy993 Posts: 52
edited May 2023 in SOAtest

I am not sure what happened but I am getting this error message when trying to open a SOATest tst file. I am still able to open other test files but this one always throws this error. The full error message is:
n error has occurred. See error log for more details.
webtool.test.TestSuite cannot be cast to webtool.test.ToolTest
I am not sure exactly where the error log is so I have not been able to find any more information. After I get this error, I then receive this same error when trying to open the test files that open without error if I try them first. I also copied the test and renamed it but got the same error message when trying to open it.
Is anyone able to help? I have a number of test suites in the file that I would like to use.
Thanks for any assistance.

Comments

  • benken_parasoft
    benken_parasoft Posts: 1,231 ✭✭✭
    Options

    I am not sure exactly where the error log is so I have not been able to find any more information

    "An error has occurred. See error log for more details" is a general message from the Eclipse IDE. You can view that particular error log by clicking "Windows > Show View > Error Log". You should see the error shown there. If you double-click the error then you should see a stack trace which would be helpful to share.

    Is anyone able to help? I have a number of test suites in the file that I would like to use.

    You may want to contact Parasoft Support but I can help you here if you can share the stack trace shown in the error log. However, it would be even better if you can share a copy of the tst file that does not open and also indicate the exact version of SOAtest you are using to open the file. A ClassCastException can happen if opening a tst that was saved in a newer version of the product but we typically show a better error message in that case and not "An error has occurred".

  • Speedy993
    Speedy993 Posts: 52
    Options

    I think you may be correct in that this is the result of the tst being saved in a newer version of SOATest. We tried to go to the latest version of SOATest and had to move to a version that was a little older because of limitations of the version of Java we have in our current applications here (and as well as similar issues with Selenic). Is there a way to somehow downgrade the SOATest version associated with the tst file or has it been permanently updated? We are currently using version Version: 2021.2.0 (10.5.2.202110102000) Build id: 2021-10-10-2000
    I will paste the error messages I found in the log file here. Unfortunately, I can't upload the actual tst file because of the very tight security concerns of the data and urls contained in the test.

    Please let me know if I can provide any more information. Thanks for you assistance.

    Parasoft SOAtest
    Version: 2021.2.0 (10.5.2.202110102000)
    Build id: 2021-10-10-2000

    MESSAGE:
    Problems occurred when invoking code from plug-in: "org.eclipse.jface".

    EXCEPTION STACK TRACE
    java.lang.ClassCastException: webtool.test.TestSuite cannot be cast to webtool.test.ToolTest
    at com.parasoft.ptest.testcases.web.WebTestSuite.getWebTestCases(WebTestSuite.java:216)
    at com.parasoft.ptest.testcases.web.WebTestSuite.getSetupTestsAsList(WebTestSuite.java:195)
    at com.parasoft.ptest.testcases.web.WebTestSuite.getAllTests(WebTestSuite.java:70)
    at com.parasoft.ptest.testcases.tree.TestsCollector.collectTestsIdsSlow(TestsCollector.java:304)
    at com.parasoft.ptest.testcases.tree.TestsCollector.collectTestsIdsSlow(TestsCollector.java:307)
    at com.parasoft.ptest.testcases.tree.TestsCollector.collectTestsIdsSlow(TestsCollector.java:307)
    at com.parasoft.ptest.testcases.tree.TestsCollector.collectTestsIdsSlow(TestsCollector.java:307)
    at com.parasoft.ptest.testcases.tree.TestsCollector.startCollectTestsIdsSlow(TestsCollector.java:278)
    at com.parasoft.ptest.testcases.tree.TestsCollector.collectProjectTestsIds(TestsCollector.java:406)
    at com.parasoft.ptest.testcases.tree.TestsCollector.getCollectedProjectTestsIds(TestsCollector.java:369)
    at com.parasoft.ptest.testcases.tree.TestsCollector.getProjectTestCasesIds(TestsCollector.java:123)
    at com.parasoft.ptest.testcases.tree.TestCasesTreeUtil.getMainTestCaseIds(TestCasesTreeUtil.java:348)
    at com.parasoft.ptest.testcases.tree.TestCasesTreeUtil.getTestStatus(TestCasesTreeUtil.java:132)
    at com.parasoft.ptest.testcases.tree.TestCasesTreeUtil.getDecoratorURL(TestCasesTreeUtil.java:95)
    at com.parasoft.ptest.testcases.tree.TestCasesTreeContentProvider.getImage(TestCasesTreeContentProvider.java:315)
    at com.parasoft.ptest.testcases.tree.TestCasesTreeLabelProvider.getImage(TestCasesTreeLabelProvider.java:52)
    at com.parasoft.ptest.common.eclipse.ui.tree.LabelProviderWrapper.getImage(LabelProviderWrapper.java:65)
    at org.eclipse.jface.viewers.WrappedViewerLabelProvider.getImage(WrappedViewerLabelProvider.java:104)
    at org.eclipse.jface.viewers.WrappedViewerLabelProvider.update(WrappedViewerLabelProvider.java:149)
    at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:144)
    at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:954)
    at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:121)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
    at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:1032)
    at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:427)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
    at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2111)
    at org.eclipse.jface.viewers.StructuredViewer.internalUpdate(StructuredViewer.java:2094)
    at org.eclipse.jface.viewers.StructuredViewer.update(StructuredViewer.java:2035)
    at org.eclipse.jface.viewers.ColumnViewer.update(ColumnViewer.java:545)
    at org.eclipse.jface.viewers.StructuredViewer.update(StructuredViewer.java:1979)
    at com.parasoft.ptest.common.eclipse.ui.tree.EclipseTreeViewer.nodesChanged(EclipseTreeViewer.java:384)
    at com.parasoft.ptest.testcases.tree.AbstractTestCasesTreeBuilderListener.refreshNode(AbstractTestCasesTreeBuilderListener.java:324)
    at com.parasoft.ptest.testcases.tree.AbstractTestCasesTreeBuilderListener.treeModified(AbstractTestCasesTreeBuilderListener.java:96)
    at com.parasoft.ptest.testcases.eclipse.ui.TestCasesTreeBuilderListener.access$1(TestCasesTreeBuilderListener.java:1)
    at com.parasoft.ptest.testcases.eclipse.ui.TestCasesTreeBuilderListener$3.run(TestCasesTreeBuilderListener.java:120)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4005)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3633)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1158)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1047)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:658)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1420)

    SESSION DATA:
    eclipse.buildId=unknown
    java.version=1.8.0_302
    java.vendor=Azul Systems, Inc.
    BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
    Framework arguments: Files\Parasoft\SOAtest & Virtualize\2021.2\2021.2\eclipse.exe -product com.parasoft.ptest.soavirt.product
    Command-line arguments: -os win32 -ws win32 -arch x86_64 Files\Parasoft\SOAtest & Virtualize\2021.2\2021.2\eclipse.exe -product com.parasoft.ptest.soavirt.product

    I also see this error:

    Message:
    Unhandled event loop exception

    EXCEPTION STACK TRACE:
    java.lang.ClassCastException: webtool.test.TestSuite cannot be cast to webtool.test.ToolTest
    at com.parasoft.ptest.testcases.web.WebTestSuite.getWebTestCases(WebTestSuite.java:216)
    at com.parasoft.ptest.testcases.web.WebTestSuite.getSetupTestsAsList(WebTestSuite.java:195)
    at com.parasoft.ptest.testcases.web.WebTestSuite.getAllTests(WebTestSuite.java:70)
    at com.parasoft.ptest.testcases.tree.TestsCollector.collectTestsIdsSlow(TestsCollector.java:304)
    at com.parasoft.ptest.testcases.tree.TestsCollector.collectTestsIdsSlow(TestsCollector.java:307)
    at com.parasoft.ptest.testcases.tree.TestsCollector.collectTestsIdsSlow(TestsCollector.java:307)
    at com.parasoft.ptest.testcases.tree.TestsCollector.startCollectTestsIdsSlow(TestsCollector.java:278)
    at com.parasoft.ptest.testcases.tree.TestsCollector.getCollectedTestsIds(TestsCollector.java:235)
    at com.parasoft.ptest.testcases.tree.TestsCollector.getSuiteTestCasesIds(TestsCollector.java:99)
    at com.parasoft.ptest.testcases.tree.TestCasesTreeUtil.getMainTestCaseIds(TestCasesTreeUtil.java:340)
    at com.parasoft.ptest.testcases.tree.TestCasesTreeUtil.getTestCasesIds(TestCasesTreeUtil.java:318)
    at com.parasoft.ptest.testcases.tree.TestCasesTreeUtil.getCompactStatisticsText(TestCasesTreeUtil.java:240)
    at com.parasoft.ptest.testcases.tree.TestCasesTreeContentProvider.getTooltipText(TestCasesTreeContentProvider.java:353)
    at com.parasoft.ptest.testcases.tree.TestCasesTreeLabelProvider.getTooltip(TestCasesTreeLabelProvider.java:78)
    at com.parasoft.ptest.common.eclipse.ui.tree.EclipseTreeViewer$1.getTooltip(EclipseTreeViewer.java:79)
    at com.parasoft.ptest.common.eclipse.ui.tree.AbstractTreeTooltipUpdator.mouseHover(AbstractTreeTooltipUpdator.java:127)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:212)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4213)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1037)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4030)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3630)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1158)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1047)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:658)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1420)

    SESSION DATA:
    eclipse.buildId=unknown
    java.version=1.8.0_302
    java.vendor=Azul Systems, Inc.
    BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
    Framework arguments: Files\Parasoft\SOAtest & Virtualize\2021.2\2021.2\eclipse.exe -product com.parasoft.ptest.soavirt.product
    Command-line arguments: -os win32 -ws win32 -arch x86_64 Files\Parasoft\SOAtest & Virtualize\2021.2\2021.2\eclipse.exe -product com.parasoft.ptest.soavirt.product

  • jakubiak
    jakubiak Posts: 798 admin
    Options

    What version of SOAtest were you originally using, and which newer version did you update to?

  • benken_parasoft
    benken_parasoft Posts: 1,231 ✭✭✭
    edited May 2023
    Options

    We tried to go to the latest version of SOATest and had to move to a version that was a little older because of limitations of the version of Java we have in our current applications here (and as well as similar issues with Selenic)

    SOAtest 2021.2 was the last release that you could run with Java 8. SOAtest 2022.1 and later require Java 11. However, this is just the version of Java that is required to run SOAtest. Which java you use to run SOAtest should generally not impact SOAtest's ability to test applications, like the ability to send and receive messages over HTTP or other protocols. Newer releases of java have changes to what security protocols and algorithms are enabled by default but things are configurable. For example, Java 11 enables support for TLS 1.3 which can be disabled if your application-under-test doesn't work correctly with TLS 1.3. You can also re-enable insecure SSL algorithms if needed. I may be able to make a suggestion if you can explain what problem or limitation you are encountering.

    Is there a way to somehow downgrade the SOATest version associated with the tst file or has it been permanently updated?

    Not really. We highly recommend tracking test assets including SOAtest .tst files using a source control system like git. This way any changes are tracked and you can revert changes if needed. However, before SOAtest saves a tst file it first makes a copy with a ".bak" extension in case something were to go wrong, so your .tst file is not lost if writing to disk was interrupted for any unexpected reason. You can rename the ".bak" file to ".tst" and see if it opens. However, if the tst was already saved at least a couple times in the newer version then the ".bak" file would be a copy of the file which was already saved in the newer version.

    Please let me know if I can provide any more information.

    Having exact reproduction steps or a sample tst file would be great. The error you show is not what typically happens when trying to open a tst saved in the newer version of the product. The information you provided suggests that the tst file was read successfully but that the test suite model in memory is in an inconsistent state.