Share on Google+Share on Google+

Paul Singleton
Selenium RC
2 Answer(s)      8 years ago
Posted in : Java Beginners


View Answers

April 3, 2009 at 2:35 AM

sorry should be a little more clear, after the classes have been created I want to add them in the the same test so it creates a UID for one section and then logs in on a different part of the site to confirm the account is created.

March 25, 2013 at 1:55 PM

Below info gives a good begining
OOPS concepts

Object-An object is a software bundle of related state(Color,Height etc) and behavior(Selection).An object stores its state in fields (variables) and exposes its behavior through methods (functions).Ex-Vehicle.

Class-Class is ma collection of objects.

Inheritance-Different kinds of objects often have a certain amount in common with each other. Cars,Bikes etc for example, all share the characteristics of vehicles (speed, gear).
class Student{
 int rollno;
 String name;

 void insertRecord(int r, String n){  //method

 void displayInformation(){System.out.println(rollno+" "+name);}//method

 public static void main(String args[]){
  Student s1=new Student();
  Student s2=new Student();




The syntax for creating a subclass is simple. At the beginning of your class declaration, use the extends keyword, followed by the name of the class to inherit from:

class car extends vehicle {

 Interface-interface is a group of related methods without definition i.e code in them. Class which implements the interface defines the methods.     Ex- Buttons on a Remote act as Interface betweenTV and the viewer. A  vehicles behavior, if specified as an interface, might appear as  follows:interface Vehicle {
    void changeGear(int newValue);
    void speedUp(int increment);
To implement this interface, the name of your class would change (to a particular brand of vehicle, for example, such as car), and you'd use the implements keyword in the class declaration:
class car implements vehicle {
    public void changeGear(int newValue){     System.out.println("Change gear");}    public void speedUp(int increment){
System.out.println("Change speed");}}
Package-A package is a namespace that organizes a set of related classes and interfaces. Conceptually you can think of packages as being similar to different folders on your computer. 
 Selenium Server

Selenium Server receives Selenium commands from your test program, interprets them, and reports back to your program the results of running those tests.

Installing Selenium Server

Install Java SE Development Kit 7u15 and then Eclipse for Java EE Developers(Juno).

The Selenium RC server is simply a Java jar file (selenium-server-standalone-<version-number>.jar), which doesnâ??t require any special installation. Just downloading the zip file and extracting the server in the desired directory is sufficient.

Running Selenium Server

Before starting any tests you must start the server. Go to the directory where Selenium RCâ??s server is located and run the following from a command-line console.

java -jar selenium-server-standalone-<version-number>.jar

This can be simplified by creating a batch file(.bat) containing the command above. Then make a shortcut to that executable on your desktop and simply double-click the icon to start the server.For the server to run youâ??ll need Java installed.

Using the Java Client Driver

â?? Download Selenium java client driver zip from the SeleniumHQ downloads page.
 â?? Extract selenium-java-<version-number>.jar file
 â?? Open Java IDE i.e Eclipse
 â?? Create a java project using File-New-Java Project
â?? Then create a package using File-New-Package.
â?? Then create TestNG Class from File-New-Other-TestNG-TestNG Class.
 â?? Add the selenium-java-<version-number>.jar files to your project as references.Right click on Project and select Build Path-Configure build path. 

Select Libraries tab and click on Add external jars.-

1)Add Java client jars

2)Add TestNG jar

Xpath-Install Firebug and xpath checker addons in Firefox. Open Firebug from Tools-Web developer-Firebug-Open Firebug.In xpath checker write xpath in the format //input[@id='xxx'] by using the HTML tag displayed in Firebug. Then the object will be displayed in XPath Checker window.

Sample TestNG code

package sampleTest;

import org.testng.annotations.Test;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.AfterClass;

import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;

public class NewTest {

 protected Selenium sel;

  public void start() {

  public void startServer() {
   sel = new DefaultSelenium("localhost",4444,"*firefox","");

   catch(Exception e)


  public void stopserver() {



Learning the API
Starting the Browser

setUp("", "*firefox");-This starts a Browser instance.The parameters required when creating the browser instance are:host-Normally localhost is passed. This is optional parameter.port-This is optional parameterbrowserurlReporting ResultsJava has two commonly used test frameworks, JUnit and TestNG. .NET also has its own, NUnit.

Related Tutorials/Questions & Answers:
Selenium RC - Java Beginners
Selenium RC  Hi, How do split the classes into smaller files and include them in selenium RC, example I want to have a seperate class for log in, a seperate one for user creations ect.  sorry should be a little more
selenium rc java client driver - WebSevices
selenium rc java client driver  how to implement getcookies functions in selnium rc??? i m using getcookies function in selenium rc java client driver. but its given some error. pls tell me whether i have 2 write code
Selenium-HP-Alm framework
Selenium-HP-Alm framework  selenium-hp-alm framework
Selenium webdriver - Getting Xpath for element in IE
Selenium webdriver - Getting Xpath for element in IE   How to get Xpath for element in IE
Selenium webdriver - Getting Xpath for element in IE
Selenium webdriver - Getting Xpath for element in IE   How to get Xpath for element in IE
How to get Page Source in Selenium (WebDriver) using Java?
How to get Page Source in Selenium (WebDriver) using Java?  Hi, I am working on Selenium test cases for testing the web application. Now I have to get the source of the web page. How to get Page Source in Selenium (WebDriver
provided are a Selenium RC test runner, a Selenium Core exporter and a Watir exporter. A recorder based on Selenium RC is also provided for recording directly...; CubicTest is a visual Eclipse plug-in for writing Selenium and Watir tests
Eclipse Plugin-Rich Client Applications
Eclipse Plugin-Rich Client Applications       OpenTime/RC OpenTime/RC is an open-source and standards compliant solution to time and expense data collection
Sunstar  Hi I am new to java and I'm trying to work on the program add item to shopping cart I would appreciate if you could help me out. I need to add items to a shopping cart in a web application and I'm using selenium
Multiple url handling
Multiple url handling  I want to pick URLs from excel/CSV file and assign those urls to String variable and use that string variable to open the specified url from browser. I have written code to open browser using selenium
The path to the driver executable must be set by the webdriver.gecko.driver system property
the selenium for testing application? Exception in thread "main...; System.setProperty("webdriver.gecko.driver", "C:\\DeepakData\\selenium\\geckodriver.exe
Lambda Expressions example in Eclipse
the JDK 8 RC build and configure it with Eclipse IDE. You will also learn how... will show you how you can set-up the development environment using Java 8 RC... 8 RC build from Following screen shot shows the link
Sql querry not working
of slabs. CBID is cutblock ID. My code: ResultSet rc=st.executeQuery("select
can modify this application connection with database
java.awt.event.*; public class RC extends JFrame implements ActionListener...("$##.##"); public RC(){ setLayout(null); lab=new JLabel("Welcome...[]args){ new RC(); } }   
Error - Development process
= "=(RC[-27]-0)/3600" Range("AC2").Select Selection.AutoFill Destination...("AD2").FormulaR1C1 = "=IF(RC[-21]>RC[-22],0,SQRT(RC[-22]^2-RC[-21]^2...:=xlFillDefault Range("AE1").Value = "EL(RAD)" Range("AE2").FormulaR1C1 = "=(RC
how to convert java Applet to Jave Frame
*; public class RC extends Applet implements ActionListener{ TextField... java.text.*; import java.awt.event.*; public class RC extends JFrame implements... DecimalFormat("$##.##"); public RC(){ setLayout(null); lab=new JLabel
About National Museum of Delhi India
, the then Governor-General of India, Shri R.C. Rajagopalachari inaugurated the National
Introduction to RCFaces
-pattern>/rc-content/*</url-pattern> </servlet-mapping> </web
PHP Frameworks: Which PHP Framework to choose for 2014?
use the PHPUnit testing and Selenium open source software that is used
how to add database in Java Applet
java.util.*; import java.text.*; import java.awt.event.*; public class RC extends
displaying List of records from database in a jsp using ajax
var="rc" items="${listKey}"> <tr bgcolor="grey">
Installing Java
for all the GUI based applications. rc\ directory : This directory contains
Installing Java
for all the GUI based applications. rc\ directory : This directory contains
problem with executing JSF file(Build failed)
Contents </servlet-name> <url-pattern>/rc
Java Spring Hibernate Struts Training What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? file location SASLError using PLAIN: not-authorized how to convert war file into .exe file using java code


Advertisement null