Questions tagged [http-unit]

a Java library for the automatic stimulation and testing of web applications

References:

63 questions
1
vote
1 answer

How to enter text into input via httpUnit

I've got a class assignment to test using httpUnit a use case that involves entering text into a textbox even though it is not wrapped in a form tag. Without a form to look inside, how do I send text or set the value? GetElementWithId doesn't allow…
Brantley Blanchard
  • 1,208
  • 3
  • 14
  • 23
1
vote
1 answer

Retrieve the final redirect url with HttpUnit

I am using HttpUnit to simulate this web site : http://www.voyages-sncf.com/ This is my code : It don't sent to me the final redirect url just the url for searching not the result public class TestHttpUnit { public static void main(String[]…
asma
  • 75
  • 1
  • 10
1
vote
1 answer

How to run the servlet test by using HttpUnit servlet runner? Problems in Starting up with ServletUnit?

I was planning to unit test my Servlet through ServletUnit and ran across some problems : - As a starting point, we are supposed to create a ServletRunner object. One of the constructors expects File object with web.xml file. I provide the full path…
M.S.Naidu
  • 2,239
  • 5
  • 32
  • 56
1
vote
1 answer

Run tests against WAR

The folder structure of my application doesn't resemble a WAR file. Configuration files like web.xml are in a configuration folder, message bundle/resource files are in a resources folder, resource files stored as UTF-8, etc.. An Ant build is used…
Matt
  • 4,515
  • 5
  • 22
  • 29
1
vote
0 answers

HttpUnit not honoring load-on-startup in web.xml

I'm still trying to navigate how the httpunit class architecture works, but I've come across an issue where I'm not seeing my "load-on-startup" directives in web.xml being honored when I use ServletRunner. Is there a standard way to make this work,…
Ryan
  • 1,557
  • 9
  • 11
1
vote
1 answer

httpunit PutMethodWebRequest throws IOException; bad file descriptor

Could someone explain why this httpunit test case keeps failing in wc.getResponse with "bad file descriptor". I added the is.close() as a guess and moved it before and after the failure but that had no effect. This tests put requests to a Dropwizard…
Bradjcox
  • 1,509
  • 1
  • 18
  • 30
1
vote
0 answers

How to get webLinks having specific attribute in HTTPUnit

We have the API for getting all the WebLinks known as response.getLinks() assuming you have fetched the WebResponse in response. See the problem is I want to fetch only those anchor tags which have specific attribute like all those anchor tags which…
Sachin Jain
  • 21,353
  • 33
  • 103
  • 168
1
vote
1 answer

Error in HTTPUnit Code

I am trying to learn HTTPUnit and have read cookbook mentioned on http://httpunit.sourceforge.net/doc/cookbook.html But when I am trying this very simple code package httpUnit.test; import java.io.IOException; import…
Sachin Jain
  • 21,353
  • 33
  • 103
  • 168
1
vote
0 answers

Test WEB service by HttpUnit

I have Java web project and test cases for servlet.Servlet is in other maven(not web) project and declaration for that servlet wrote in web.xml of web project. For testing I use HttpUnit.In this case when I call context.getRealPath("") from my…
Ashot
  • 77
  • 5
1
vote
1 answer

Two form submissions in the same packet

I have the following code in my test: WebResponse response = webConversation.getResponse(loginUrl); System.err.println("Session ID:" + webConversation.getCookieValue("JSESSIONID")); WebForm form = response.getFormWithID(loginFormId); for(String…
Thom
  • 14,013
  • 25
  • 105
  • 185
1
vote
1 answer

how to handle the onclick on webimage in httpunit

I am using httpunit. In my application i have an image with just a src and a onclick .A javascript is called on the onclick of the image. It further call a next page. the code snippet is as follows WebImage image =…
1
vote
2 answers

 characters has occurred an error when i use the HttpUnit

I am using the HttpUnit to simulate the submit button click of the form that designed into the specified url. (I am using http://stu21.kntu.ac.ir/Login.aspx). I use the code as follow to get response page. WebConversation conversation = new…
Hossein Mobasher
  • 4,382
  • 5
  • 46
  • 73
0
votes
1 answer

Easiest way to submit a form to ServletUnit using something like WebRequest in HttpUnit

I would like to programmatically create a form with fields etc, however i have not been able to find a public factory etc to create a WebForm(class). Once this is done i would like to then submit the form and have my servlet do stuff with the…
mP.
  • 18,002
  • 10
  • 71
  • 105
0
votes
1 answer

Java, PhpBB and creation of new topic

I need to programmly create topics on my board. I use Java and HtmlUnit for this. But there is one problem — if program post once all is okay (forum response is http 200), but if start program again then PhpBB response is «http 304» and redirection…
Clark
  • 2,083
  • 6
  • 32
  • 47
0
votes
1 answer

HtmlUnit Dependency Error - NoClassDefFoundException

recently I've been trying to use the HtmlUnit API, but for some reason, I'm unable to have all the dependencies I need. The first thing I did was go on the HtmlUnit site and search for a full list of the…