• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

HttpUnit web-app problem

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am working on a web application integration using Flex and Java as the back-end. HttpUnit is used to pull data from websites. However, as a standalone app, the java code(HttpUnit) works as expected. When integrated with Flex, the WebConversation method: getResponse(WebRequest) hangs.

Is HttpUnit supposed to be used as standalone app? If not where am i going wrong.

ps. Already checked with the Adobe ...Flex has nothing to do with it. Wrote tests to verify.

Below is a code snippet: "//<<---Hangs" indicates where it hangs.

HttpUnitOptions.setScriptingEnabled(false);
WebConversation conversation = new WebConversation();

try
{
WebRequest request = new GetMethodWebRequest(this.INDEX_PAGE);
WebResponse response = conversation.getResponse(request); //<<--Hangs!!
WebForm [] loginForms = response.getForms(); //only one form on page

for(WebForm loginForm : loginForms)
{
if(loginForm.getAction().equals(siteLoginURL)
{
loginForm.setParameter("session_key", this.username);
loginForm.setParameter("session_password", this.password);
response = loginForm.submit();
request = new GetMethodWebRequest(homeURL);
response = conversation.getResponse(request);
pageSource = response.getText();
}
}
}
catch (IOException e) { e.printStackTrace(); }
catch (SAXException e) { e.printStackTrace(); }
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aren't Flex applications Flash-based? HttpUnit only understands HTTP and HTML so I'm kind of puzzled about what exactly you're trying to test with HttpUnit?
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic