Testing table filter

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

Testing table filter

Postby balle » Mon Oct 11, 2010 2:38 am

Hi all,

I try to test a filter for table rows. Therefore I need to test that a HasTextCondition fails.
First I tried a NotCondition:

ui.assertThat(new NotCondition(new HasTextCondition(new TableCellLocator(13, "Fond").in(new ViewLocator("de.patronas.opus.client.rcp.trading.orderbook.view.orderbookView")), "3")));

This results in a UnsopportedMethod exception:
java.lang.RuntimeException: unsupported method - should call testUI(IUIContext) instead
at com.windowtester.runtime.condition.HasTextCondition.test(HasTextCondition.java:46)
at com.windowtester.internal.runtime.condition.NotCondition.test(NotCondition.java:17)
at com.windowtester.internal.runtime.condition.ConditionMonitor.test(ConditionMonitor.java:177)
at com.windowtester.runtime.swt.internal.UIContextSWT.wait(UIContextSWT.java:809)
at com.windowtester.runtime.swt.internal.UIContextSWT.wait(UIContextSWT.java:795)
at com.windowtester.runtime.internal.AssertionHandler.waitFor(AssertionHandler.java:62)
at com.windowtester.runtime.internal.AssertionHandler.assertThat(AssertionHandler.java:30)
at com.windowtester.internal.runtime.UIContextCommon.assertThat(UIContextCommon.java:225)
at de.patronas.opus.client.rcp.test.orderbook_test.OrderbookTest.testOrderbookTest(OrderbookTest.java:50)
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 junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at com.windowtester.runtime.common.UITestCaseCommon.access$0(UITestCaseCommon.java:1)
at com.windowtester.runtime.common.UITestCaseCommon$2.run(UITestCaseCommon.java:130)
at com.windowtester.runtime.common.UITestCaseCommon$3.run(UITestCaseCommon.java:151)
at com.windowtester.internal.runtime.junit.core.SequenceRunner$1.run(SequenceRunner.java:40)

Is there another way to test that a table row is absent without testing on a waittimeout exception?
Greets

Balle
balle
 
Posts: 5
Joined: Fri Oct 08, 2010 7:22 am

Re: Testing table filter

Postby Littlejenny » Wed Oct 13, 2010 6:24 pm

base on my knowledge, we still cannot test without waittimeout exception
Littlejenny
 
Posts: 1
Joined: Mon Oct 11, 2010 6:58 pm

Re: Testing table filter

Postby keertip » Mon Oct 18, 2010 8:33 am

You would need to go through the rows in the table, checking each one a condition that ensures the table filter is working.
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest

cron