The Artima Developer Community
Sponsored Link

Java Buzz Forum
JWebUnit - A Godsend

5 replies on 1 page. Most recent reply: Feb 10, 2005 11:22 AM by Jeff

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 5 replies on 1 page
Matthew Christensen

Posts: 7
Nickname: mchristens
Registered: Jun, 2003

Matthew Christensen is a professional java developer and consultant.
JWebUnit - A Godsend Posted: Jun 26, 2003 11:43 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Matthew Christensen.
Original Post: JWebUnit - A Godsend
Feed Title: Bees Who Died At Sea
Feed URL: http://www.contegix.com/bees/index.rdf
Feed Description: My thoughts on programming, mostly in Java. Occasional thoughts about other things.
Latest Java Buzz Posts
Latest Java Buzz Posts by Matthew Christensen
Latest Posts From Bees Who Died At Sea

Advertisement
For me. one of the most frustrating things about building web applications has been the difficulty in unit testing them. I've tried many approaches, none of them easy/powerful enough to help much. Finally -- a godsend. I downloaded and started...

Read: JWebUnit - A Godsend


Suresh Babu

Posts: 2
Nickname: sureshbvs
Registered: Nov, 2003

Re: JWebUnit - A Godsend Posted: Aug 21, 2004 11:35 PM
Reply to this message Reply
I liked to study JWEBUNIT. I have downloaded JWEBUNIT, J2SDK1.4, Apache Tomcat etc.. I find some sample codes in JWEBUNIT.. How to check it? Please let me know step by step instructions.. sent a mail to sureshbvs@asianetindia.com

Regards

Suresh

Amit Bonde

Posts: 1
Nickname: amitbonde
Registered: Jan, 2005

Re: JWebUnit Posted: Jan 19, 2005 11:14 PM
Reply to this message Reply
hi..

I want to automate testing of a web application developed in java. I am using Jwebunit for that.
I have tried the sample test, called "JWebUnitSearchExample" which performs a Google search for Httpunit and validates the presence of link, given in the documentation of jwebunit.
I run it through command prompt, I am not sure whether it runs successfuly as I dont get any messages and my firewall alerts me about the applicetion accessing the net. After while the application returnds to command prompt again displayin no results.
I even tried the graphical Testrunner of Junit (junit.swingui.TestRunner), but there I get an error 'Class not found "net.sourceforge.jwebunit.sample.JWebUnitSearchExample"'

How can i capture the results in jwebunit?

Also Maven and Ant are mentioned in the documentation for building Jwebunit.
Are they required to build and run test using Jwebunit?

I hope you can answer these questions immediately.

Regards,
Amit

Jeff

Posts: 1
Nickname: olddog
Registered: Feb, 2005

Re: JWebUnit - A Godsend Posted: Feb 10, 2005 11:22 AM
Reply to this message Reply
Has anyone else had any problems using JWebUnit? It is not able to find elements on my page. I think it may be because they are inside a , but don't know for sure. Is there anyone out there willing to help me? I am sure I have the names right. I checked them again and again and again.

assertTitleEquals("");
assertFormPresent("webReg");
// none of this works. I don't know why
//assertTablePresent("offerTbl");
//assertFormElementPresent("wlw-select_key:{actionForm.card_type}");
//assertFormElementPresent("card_type_Element1");
//assertFormElementPresent("wlw-radio_button_group_key:{actionForm.pmt_type}");
//assertRadioOptionPresent("wlw-radio_button_group_key:{actionForm.pmt_type}", "pmt_type_Element0");
//assertRadioOptionPresent("wlw-radio_button_group_key:{actionForm.pmt_type}", "pmt_type_Element1");
//assertRadioOptionSelected("wlw-radio_button_group_key:{actionForm.pmt_type}", "pmt_type_Element0");
//assertFormElementPresent("{actionForm.card_number");
//assertFormElementPresent("wlw-select_key:{actionForm.expire_mm}");
//assertFormElementPresent("wlw-select_key:{actionForm.expire_yy}");
//assertLinkPresent("cnclLnk");
assertButtonPresent("nxtBtn");

//selectOption("wlw-select_key:{actionForm.card_type}", "card_type_Element1") ;



Thanks

viswa kandi

Posts: 2
Nickname: vbreddymca
Registered: Feb, 2007

Re: JWebUnit - A Godsend Posted: Feb 24, 2007 8:49 AM
Reply to this message Reply
Hi
I am new to JWebUnit .I am trying to run a JWebUnit test here .But The tests are failed even the page is having the


package com.test;
import junit.framework.TestSuite;
import net.sourceforge.jwebunit.WebTestCase;
import net.sourceforge.jwebunit.TestingEngineRegistry;

public class ExampleWebTestApp extends WebTestCase {

public static void main(String[] args) {

junit.textui.TestRunner.run(
new TestSuite(ExampleWebTestApp.class ));

}

public void setUp() {

getTestContext().setBaseUrl(Messages.getString(
"ExampleWebTestApp.0")); //$NON-NLS-1$

setTestingEngineKey(TestingEngineRegistry.
TESTING_ENGINE_HTMLUN IT);

System.
out.println("Cookies" + getTestContext().getCookies()); //$NON-NLS-1$

}

public void testAllBusinessServices() {

try {

beginAt(
"/wsee_its_edit.jsp");

assertTitleEquals(
"Edit WS Intermediary Service");

}
catch (Exception ex) {

ex.printStackTrace();

}
finally {

//assertKeyPresent("test_message");

assertFormPresent(
"myform"); //$NON-NLS-1$

assertSubmitButtonPresent(Messages.getString(
"ExampleWebTestApp .4")); //$NON-NLS-1$

assertTablePresent(
"webTest"); //$NON-NLS-1$

}

}

}

when I am trying to import import net.sourceforge.jwebunit.TestingEngineRegistry;
it is giving errors.I am not able to import tha class .
And if I am not importing the class, The test cases are failing.

Thanks in Advance,
Viswa Bharat.

viswa kandi

Posts: 2
Nickname: vbreddymca
Registered: Feb, 2007

Re: JWebUnit - Problem when loading messages.properties file Posted: Feb 26, 2007 3:36 PM
Reply to this message Reply
Hi All,

I am getting an error when I am trying to load messages.properties file into my class.The file is located in the root folder of my testApplication .
I am using the code:

getTestContext().setResourceBundleName("messages");

The error i am geting
java.util.MissingResourceException: Can't find bundle for base name messages, locale en_US

Can anybody please help me ..

Thanks in Advance,
Viswa .

Flat View: This topic has 5 replies on 1 page
Topic: Bloglines And Google Reader Side By Side Previous Topic   Next Topic Topic: How to Write a Custom Swing Component

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use