Hi,

I am using tapestry to generate pages.
The login screen test works fine. 
Now I want to see that the response page that  I get from the login page has 
Form1 or not.

When I look at page info in netscape I can see Form0, Form1 and Form2.

I am getting the following Error.

*******************************************************************************************************************************************************
.F
Time: 2.154
There was 1 failure:
1) 
testFormSubmission(com.xeye.jWebUnit.LoginScreen)junit.framework.AssertionFailedError:
 No form present with name or id [Form1]
        at 
net.sourceforge.jwebunit.WebTester.assertFormPresent(WebTester.java:361)
        at 
net.sourceforge.jwebunit.WebTestCase.assertFormPresent(WebTestCase.java:152)
        at com.xeye.jWebUnit.LoginScreen.testFormSubmission(LoginScreen.java:57)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at com.xeye.jWebUnit.LoginScreen.main(LoginScreen.java:63)

FAILURES!!!
Tests run: 1,  Failures: 1,  Errors: 0

Hello

*****************************************************************************************************************************


import net.sourceforge.jwebunit.*;
import junit.framework.TestSuite;


public class LoginScreen extends WebTestCase {
        
                        


// Setting the BASE URL to access Web UI
public void setUp() throws Exception {
        
           
                String url = "http://localhost:8080/index.html";;
        
                getTestContext().setBaseUrl(url);
                
}

// The method name should begin with "test" for the TestRunner to run.

public void testFormSubmission() throws Exception{
        
        String title = "";
        beginAt("/");
        setWorkingForm("Form0");
        assertFormPresent("Form0");
        
        
        // assert that the form fields are present.
        
        assertFormElementPresent("inputUsername");
        assertFormElementPresent("inputPassword");
        assertFormElementPresent("inputStyle");
        
        // Submit the login button
        submit("loginSubmit");
        
        
        getDialog().getWebClient().getClientProperties().setAutoRedirect(true);
        getDialog().getResponse().getFormWithName("Form1");
        assertFormPresent("Form1");
        
}

public static void main(String[] args) {
        
 junit.textui.TestRunner.run(new TestSuite(LoginScreen.class));


System.out.println("Hello");
  
}
        
}

***********************************************************************************************************************


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Jwebunit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development

Reply via email to