Assert failed trying to navigate a tree [message #532665] |
Mon, 10 May 2010 18:10 |
Steven Chamberlin Messages: 30 Registered: July 2009 |
Member |
|
|
I am on SWT-Bot version 512. I have the following line of code:
bot.menu("Window").menu("Show View").menu("Other...").click();
--->bot.tree().expandNode("View Category").select("View Name");
I thought that these kinds of tree-drilling issues were fixed in the recent versions of SWT-Bot ... ? But it fails in only 1.6 seconds -- even though my timeout value is set to 120 seconds -- with the following assertion:
org.eclipse.swtbot.swt.finder.exceptions.AssertionFailedExce ption: assertion failed:
at org.eclipse.swtbot.swt.finder.utils.internal.Assert.isTrue(A ssert.java:95)
at org.eclipse.swtbot.swt.finder.utils.internal.Assert.isTrue(A ssert.java:83)
at org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.select( SWTBotTreeItem.java:437)
at org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.select( SWTBotTreeItem.java:464)
at com.ibm.datatools.swtbot.framework.ods.JavaProject.generateP ureQueryCode(JavaProject.java:54)
at com.ibm.datatools.swtbot.tests.ods.BVTTestsODS.testODS_gener atePureQueryCode(BVTTestsODS.java:89)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at org.eclipse.swtbot.swt.finder.SWTBotTestCase.runBare(SWTBotT estCase.java:228)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.OldTestClassRunner.run(OldTestCla ssRunner.java:76)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:45)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main( RemotePluginTestRunner.java:64)
at org.eclipse.swtbot.eclipse.core.UITestApplication.runTests(U ITestApplication.java:117)
at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(Work benchTestable.java:68)
at java.lang.Thread.run(Thread.java:736)
I also tried this line of code as an alternative:
bot.tree().expandNode("View Category").expandNode("View Name").click();
and it failed after 2.3 seconds (again, timeout value is 120) with this exception:
org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundExcep tion: Could not find node with text: View Name
at org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.getNode s(SWTBotTreeItem.java:329)
at org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.getNode (SWTBotTreeItem.java:304)
at org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.getNode (SWTBotTreeItem.java:341)
at org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.expandN ode(SWTBotTreeItem.java:279)
at com.ibm.datatools.swtbot.framework.ods.JavaProject.generateP ureQueryCode(JavaProject.java:54)
at com.ibm.datatools.swtbot.tests.ods.BVTTestsODS.testODS_gener atePureQueryCode(BVTTestsODS.java:89)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at org.eclipse.swtbot.swt.finder.SWTBotTestCase.runBare(SWTBotT estCase.java:228)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.OldTestClassRunner.run(OldTestCla ssRunner.java:76)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:45)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main( RemotePluginTestRunner.java:64)
at org.eclipse.swtbot.eclipse.core.UITestApplication.runTests(U ITestApplication.java:117)
at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(Work benchTestable.java:68)
at java.lang.Thread.run(Thread.java:736)
The node with that text is definitely there, and I don't know how it can determine that it is not t here in a time less than the timeout value. Please advise.
Thanks!
[Updated on: Mon, 10 May 2010 18:54] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03758 seconds