dcsimg
Problem with onChange() using HttpUnit and Javascript
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Arthur_Tobin
Posted On:   Wednesday, July 30, 2003 05:40 AM

Hi I'm trying to test a newly developed app using HttpUnit. On the page there is a Dropdown list, once selected causes the page to submit to the server (onChange())so as to populate another dropdown list, which in turn will cause another onChange event. Once this is done I fill out the remainder of the form and then hit the submit button. How can I simulate this? Essentially there are 2 onChange() Submits before the Submit button is hit. Any help would be appreciated as I am stuck on this. Thanks Arthur This is the Code that I am using WebForm loginForm = response.getForms()[0]; WebRequest request = loginForm.getRequest(); HttpUnitOptions.setExceptionsThrownOnScriptError(   More>>

Hi
I'm trying to test a newly developed app using HttpUnit. On the page there is a Dropdown list, once selected causes the page to submit to the server (onChange())so as to populate another dropdown list, which in turn will cause another onChange event. Once this is done I fill out the remainder of the form and then hit the submit button. How can I simulate this? Essentially there are 2 onChange() Submits before the Submit button is hit. Any help would be appreciated as I am stuck on this.


Thanks
Arthur


This is the Code that I am using


WebForm loginForm = response.getForms()[0];
WebRequest request = loginForm.getRequest();
HttpUnitOptions.setExceptionsThrownOnScriptError( false );
request.setParameter( AppProperties.FORM_ELEMENT_startDate, AppProperties.DATA_START_DATE);
request.setParameter( AppProperties.FORM_ELEMENT_endDate, AppProperties.DATA_END_DATE);
request.setParameter( AppProperties.FORM_ELEMENT_classID, AppProperties.DATA_CLASS);
request.setParameter( AppProperties.FORM_ELEMENT_lineOfBusiness, AppProperties.DATA_LINE_OF_BUSINESS);
request.setParameter( AppProperties.FORM_ELEMENT_assignmentLevel, AppProperties.DATA_ASSIGNMENT_LEVEL);
request.setParameter( AppProperties.FORM_ELEMENT_assignedName, AppProperties.DATA_ASSIGNED_NAME);
request.setParameter( AppProperties.FORM_ELEMENT_shortDesc, AppProperties.DATA_SHORT_DESCRIPTION);
request.setParameter( AppProperties.FORM_ELEMENT_detailedDesc, AppProperties.DATA_LONG_DESCRIPTION);
//request.setParameter( AppProperties.FORM_ELEMENT_ATTACH_file, AppProperties.DATA_ATTACH_FILE);
request.setParameter( AppProperties.FORM_ELEMENT_category, AppProperties.DATA_CATEGORY);
request.setParameter( AppProperties.FORM_ELEMENT_subCategory, AppProperties.DATA_SUB_CATEGORY);

response = conversation.getResponse( request );


This is the javascript code:



which is called by :



   <<Less
About | Sitemap | Contact