Re: Unable to view the Web Application I am testingusing httpunit
malathi gopalan <[email protected]>
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Riju, Thanks for the response. I actualy need the response in the GUI form instead of in text form. Please let me know if you know how to do it. My GUI is a Java based Web Application. I appreciate your help. Regards Malathi --- [email protected] wrote: > You can print the response by using > respObj.getText(). Moreover if you run > the test in an IDE like eclipse, in debug mode you > will be able to see the > details inside each object which is part of > conversation. > > -Riju VK > > > > > malathi gopalan > > <malathigo@yahoo. > > com> > To > Sent by: Discussion of > use and development > httpunit-develop- of HttpUnit > > [email protected] > <[email protected] > rceforge.net .net> > > > cc > > > 10/30/2007 04:21 > Subject > PM Re: > [Httpunit-develop] Unable to > view the Web > Application I am > testingusing > httpunit > Please respond to > > Discussion of use > > and development > > of HttpUnit > > <httpunit-develop > > @lists.sourceforg > > e.net> > > > > > > > > > > Thanks Band for the response. > I don't want to write the response to a page, but I > would like to view the GUI for the web application > that I am testing. > > Thanks > Malathi > > --- "Band, Tyler" <[email protected]> > wrote: > > > This is what I use to 'write' a page out - since > > this is a load test - I > > needed to uniquely identify the page so I included > a > > random system time > > and the logon name. This only writes the page out > if > > there is an error. > > Enjoy > > > > > > > > private void writeErrorPage(WebResponse > response) > > throws Exception { > > if (response != null) { > > if (pageTitle == null) > > pageTitle = > response.getTitle(); > > long time = > System.currentTimeMillis() / 1000; > > String mFilePath = > mState.getMThreadID() + "_[" > > + mState.getUserName() > + "]_" + pageTitle + > > "_" > > + String.valueOf(time) > + ".html"; > > String content = > response.getText(); > > FileOutputStream out = new > > FileOutputStream(mFilePath); > > PrintWriter writer = new > PrintWriter(out); > > writer.print(content); > > writer.close(); > > pageTitle = null; > > } > > } > > > > Tyler Band > > Marriott Vacation Club > > Orlando, FL > > > > -----Original Message----- > > From: > [email protected] > > > [mailto:[email protected]] > > On Behalf Of > > malathi gopalan > > Sent: Tuesday, October 30, 2007 3:21 PM > > To: [email protected] > > Subject: [Httpunit-develop] Unable to view the Web > > Application I am > > testingusing httpunit > > > > Hi, > > > > I am using HttpUnit1.6 and jdk 1.5_02. > > I am trying to test a Web Application using > httpunit > > and I am able to have the web conversation with > the > > application and getting the appropiate values for > my > > > > tests, Everything is happening in the background, > I > > would like to view what is happening in the > > application for example the login page, view the > > form > > submit, clicking on a link etc. > > > > I appreciate if anyone can help me. > > > > Thanks > > > > Below is the code that I used for HttpUnit. > > > > public class sampleHttpUnitTest extends TestCase > > { > > public void testConnection() throws Exception > > { > > > > String url = "www.bmc.com" > > WebConversation wc = new > WebConversation(); > > > > WebRequest request = new > > GetMethodWebRequest(url); > > > > WebResponse response = > > wc.getResponse(request); > > > > assertEquals("The Web page returned the > > wrong > > respons code ",200, > > response.getResponseCode()); > > > > System.out.println("Title : " + > > response.getTitle()); > > > > WebLink [] webLinkList = > > response.getLinks(); > > > > String[] elementNameList = > > response.getElementNames(); > > > > for(WebLink weblink : webLinkList ) > > { > > System.out.println(" WebLink Text is " > + > > weblink.getText()); > > > > } > > > > for(String elementName : elementNameList ) > > { > > System.out.println(" ElementName is " > + > > elementName); > > } > > > > WebForm [] webFormList = > > response.getForms(); > > > > for(WebForm webForm : webFormList) > > { > > System.out.println("name : "+ > === message truncated === __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/