Thanks everyone who helped me getting this solved.
Those who are facing same kind of problem, please find the solution below.
Step1: Create ClassA:
package SmokeTest;
import com.thoughtworks.selenium.*;
public class ClassA extends SeleneseTestCase {
public ClassA(Selenium selenium) {
super.selenium = selenium;
}
public void test_Login() throws Exception
{
try{
selenium.setTimeout("60000");
selenium.open("codesearch");
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
}
Step2: Create ClassB
package SmokeTest;
import com.thoughtworks.selenium.*;
public class ClassB extends SeleneseTestCase {
ClassA a;
public void setUp() throws Exception
{
setUp("
http://google.com", "*iexplore");
a = new ClassA(super.selenium);
}
public void test_01 throws Exception
{
try
{
a.test_Login();
}
catch(Exception ex)
{
System.out.println(ex);
ex.printStackTrace();
}
}
}
Step3: Execute these test cases.
package SmokeTest;
import com.thoughtworks.selenium.*;
import junit.framework.*;
import java.io.*;
import junit.textui.TestRunner;
public class CRLogin extends SeleneseTestCase {
public static Test suiteToRun(){
TestSuite suite = new TestSuite();
suite.addTestSuite(ClassA.class);
return suite;
}
public static void main(String[] args) {
TestRunner.run(suiteToRun());
}
}
Cheers,
Sikander