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
by ninaonao » Tue Oct 05, 2010 3:39 am
I have created several test cases in one java class, they all passed if I ran them one by one. But if I ran them together, only the first test case pass, how to run them together in one class?
-
ninaonao
-
- Posts: 7
- Joined: Mon Oct 04, 2010 4:38 am
by ninaonao » Wed Oct 06, 2010 1:23 am
Well...This is not the way I want to do it. I want to put all the test cases which related to one window in one java class, and I have quite a lot of windows which mean I have lots of classes. I don't want to including all my single test case in a Test Suite. But thank you anyway!
-
ninaonao
-
- Posts: 7
- Joined: Mon Oct 04, 2010 4:38 am
by keertip » Wed Oct 06, 2010 12:21 pm
Are you looking at having several test methods, all exercising a single view in one class?
- Code: Select all
public class TestView extends UITestCaseSWT {
/* @see junit.framework.TestCase#setUp()
*/
protected void setUp() throws Exception {
super.setUp();
// add code in here to initialize view for start of test
// this is called before the test is executed
}
public void test1() throws Exception {
...
}
public void test2() throws Exception {
...
}
public void test3() throws Exception {
...
}
}
-
keertip
- Moderator
-
- Posts: 221
- Joined: Thu Mar 15, 2007 10:26 am
by ninaonao » Wed Oct 06, 2010 11:55 pm
Thank you! That's what I did, but only the first test case passed, the rests failed. I don't know why.
-
ninaonao
-
- Posts: 7
- Joined: Mon Oct 04, 2010 4:38 am
by keertip » Thu Oct 07, 2010 2:01 pm
At the start of the second test, is the view in the initialized state? Interactions from the first test may have changed the state of the view.
-
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