Testing (87 products)

  • 10/10 Selenium
    Selenium is a tool that tests web applications directly from a browser...
  • 9/10 Modassert
    "This is an advanced portable C++ library with 80 variations of the...
  • 9/10 Jdo-tools
    "The JDO Learning Tools demonstrate the behavior of Sun's Java Data...
  • 9/10 Mockcentral
    "MockCentral is an easy-to-use, fully-featured set of tools that...
  • 8/10 Lintian
    Debian package checker.Lintian dissects Debian packages and reports...
[see all]
Create a set of features for Testing so you can compare software applications in this class

Forum


Validating Radio Buttons Using HttpUnit

Hi,
I am trying to write a test case to simulate a radio option using HttpUnit.

My form looks like this:









Existing Mobile Number
Select a number



New Mobile Number
Number




...



and my test case looks like this;

WebForm[] forms = response.getForms();
WebForm form = forms[0];

String number = phoneNumber.getArea()+phoneNumber.getThree()+phoneNumber.getFour();
System.out.println("PHONE NUMBER TO SET: " + number);
String radioGroupName = "phoneList";

String[] options = form.getOptions(radioGroupName); //this returns the labels of the radio button
String[] optionsValues = form.getOptionValues(radioGroupName); //this returns true and false as per HttpUnit API

for (int i = 0; i < options.length; i++) {
if (options[i].equals("Existing Mobile Number")) {
System.out.println("Existing");
//do something
} else {
System.out.println("New");
//do something
}
}

For some reason, form.getOptions(radioGroupName) returns empty string. How do I decide which radio option is selected?

Any advise is highly appreciated.

Thanks.
Sandy
[...]
Date: October 31, 2008 at 18:08 Author: sandy_ajit
Last post: October 31, 2008 at 18:08 Replies: 0
Please Suggest
Can we do data validation using HTTP unit. If yes please could ne one explain with an example.

Thanks in Advance
[...]
Date: October 3, 2008 at 01:45 Author: Golu
Last post: October 3, 2008 at 01:45 Replies: 0
IEUnit features
What all features do IeUnit have?
[...]
Date: August 29, 2008 at 07:20 Author: Mighty
Last post: August 29, 2008 at 07:20 Replies: 0
Unit testing with ASPUnit
I am relatively new to ASP and ASPUnit, but have worked with C sharp.Net development and NUnit unit testing. I have downloaded the ASPUnit.zip from the http://aspunit.sourceforge.net/ website and added the contents (.asp, .js files etc) in the unzipped folder to an application in Visual Interdev. I played around with the TCTest.asp file to get the hang of it. But I couldnt find any particular guidelines, examples on how exactly to use ASPUnit?

And I have a few questions and clarifications regarding ASPUnit usage:
* It is my understanding that ASPUnit can only be used for server side VBScript code. Therefore it cannot be used for Javascript code at all, correct?
* I saw how a code written within the test method itself can be tested using the Assertions. But how can I test code of another class? E.g. How can I call the Methods written in my ClassA from my Test application TestClassA? I tried with