n.chenththuran

Ranch Hand
+ Follow
since Jun 16, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by n.chenththuran

I wanted to test the order placement using selenium. I did the following
1. recorded the order placement using selenium IDE(i.e login to the website, find a product , add to basket, fill the payment and submit the order which will direct to order confirmation page)
2. exported the testcase to java
3. Ran the converted testcase using Eclipse

Testcase is executed and order is placed. But, immediately browser is closed. Why is this happening.

my selenium script has been given below

import com.thoughtworks.selenium.*;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.regex.Pattern;
import junit.framework.*;
import junit.framework.Test;

import java.sql.*;

import org.junit.*;

import java.util.regex.Pattern;

public class Order extends SeleneseTestCase {
public void setUp() throws Exception {
setUp("http://stage.tjhughes.fresca.co.uk/pws/Home.ice", "*chrome");
}



public void testNew() throws Exception {


selenium.open("/");

assertEquals("TJ Hughes - TJ Hughes - Home", selenium.getTitle());
selenium.click("link=Mobile Phones");
selenium.waitForPageToLoad("30000");
assertEquals("TJ Hughes - TJ Hughes - Category List", selenium.getTitle());
selenium.click("//img[@alt='view details']");
selenium.waitForPageToLoad("30000");
assertEquals("TJ Hughes - Slider Style Handset With Built In 2 Megapixel Camera.", selenium.getTitle());
selenium.click("addToBasket");
selenium.waitForPageToLoad("30000");
assertEquals("TJ Hughes - Slider Style Handset With Built In 2 Megapixel Camera.", selenium.getTitle());
selenium.click("//img[@alt='check out now']");
selenium.waitForPageToLoad("30000");
assertEquals("TJ Hughes - TJ Hughes - Login / Register", selenium.getTitle());
selenium.type("j_username", "nadarajah.chenththuran@yahoo.com");
selenium.type("j_password", "09111989");
selenium.click("//form[@id='loginForm']/fieldset/div[2]/div[3]/input");
selenium.waitForPageToLoad("30000");
assertEquals("TJ Hughes - TJ Hughes - Select Delivery Address", selenium.getTitle());
selenium.click("//form[@id='chooseAddress']/fieldset/div[3]/input");
selenium.waitForPageToLoad("30000");
assertEquals("TJ Hughes - TJ Hughes - Payment Details", selenium.getTitle());
selenium.type("paymentCardHolder", "Tom");
selenium.select("cardType", "label=VISA");
selenium.type("cardNumberError", "4111111111111111");
selenium.type("cardCVSNumberError", "123");
selenium.select("cardStartMonth", "label=01");
selenium.select("cardStartYear", "label=2009");
selenium.select("cardExpiryMonth", "label=01");
selenium.select("cardExpiryYear", "label=2011");
selenium.click("termsAndConditions");
selenium.click("//form[@id='paymentDetails']/fieldset[2]/div[16]/input");
selenium.waitForPageToLoad("30000");
assertEquals("TJ Hughes - TJ Hughes - Order Confirmation", selenium.getTitle());
}



public static Test Suite(){
return new TestSuite(Order.class);

}



public static void main(String args[]){
junit.textui.TestRunner.run(Suite());
}


I will appreciate your reply.

Thanks in advance.

Chenththuran

14 years ago
I have been working as a softwere developer.I am new to oracle... i want to take the 1Z0-042 exam... Do i need to take the SQL/PLSQL exam first? I mean, do i need to have an indepth knowledge on SQL/PL for this 1Z0-042 exam?

please help..
16 years ago
hi buddy,
the ideal book to learn OO concept is Head first. buy and feel it. worth for money

rgds,
chenththuran
i face a problem when i configure mysql server5 with windows XP home edition. Error message is " unable to start windows service for mysql ..."
Anyone knows the reason for this problem.

thanks& Rgds,
chenthuran
I am trying to find out how to clear an msdos screen using java. can anyone write a small example for me
18 years ago
i am a j2EE developer. i want to migrate to J2ME . First of all i want to write and see some small J2ME programs. Can you please guide me the required softwares and editors for writing J2ME programs and execute

advanced thanks

chenthuran
19 years ago
public boolean validate(String xmlPath, String schemaPath,Category inCat,ParameterObject pobj) throws Exception{

try {

DOMParser parser = new DOMParser();
parser.setFeature("http://xml.org/sax/features/validation", true);
parser.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",schemaPath);
ErrorHandlerInterface er=new ErrorHandlerInterface( inCat,pobj);
parser.setErrorHandler((ErrorHandler) er);
DQMLogger.logInfo("Schema validation applying schema to "+xmlPath+" using "+schemaPath,inCat);
parser.parse(xmlPath);
return er.isValid();
}
catch (Exception e){
return false;

}

}

-----------------------

i have written a validator method which doesnt work properly. could you plz advice on this. are there any alternatives?

rgds
public boolean validate(String xmlPath, String schemaPath,Category inCat,ParameterObject pobj) throws Exception{

try {

DOMParser parser = new DOMParser();
parser.setFeature("http://xml.org/sax/features/validation", true);
parser.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",schemaPath);
ErrorHandlerInterface er=new ErrorHandlerInterface( inCat,pobj);
parser.setErrorHandler((ErrorHandler) er);
DQMLogger.logInfo("Schema validation applying schema to "+xmlPath+" using "+schemaPath,inCat);
parser.parse(xmlPath);
return er.isValid();
}
catch (Exception e){
return false;

}

}


i have written a schema validator which doesnt work properly. this is the code . anybody help? any alternatives?
i wrote a client program to test an entity bean which is run in jboss server. but it does not work. some exceptions r there. anybody who have a suitable client program for jboss server plz send me to chen_uoc@yahoo.com
19 years ago
Anybody know a very good book to learn object oriented concepts. it should show issues in depth. i mean suitable to advaced users

rgds,
chenthuran
dear shalini,use head first ejb, the recommended book for ejb. if u want some similators i can help u. send a mail to chen_uoc@yahoo.com

Rgds,
chenththuran
hi, i want to know these
1. in what format my testcase should be saved( .xml , .txt, or etc)
2. where can i save my testcase ( in the jameleon tutorial the he asks to save under scripts/validLogin.xml his example testcase) but i could not find the scripts folder inside jameleon
3. how to execute the test case??

thanks and rgds,
chenththuran
19 years ago
i have my system to be tested with jameleon which is totally new to me and seems like a devil. could anybody plz help me to configure and write some test cases. sample test cases will be appreciated. i am unable to understand the sourceforge.net tutorial

thanks,
chenthuran
19 years ago
any useful tutorials for jdk1.5 ,
19 years ago
i have just seen this.. all i can say is"G..R..E..A..T".. weldone

rgds,
chenththuran