Selenium RC

Ads
 

Selenium RC

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
  rollno=r;
  name=n;
 }

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

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

  s1.insertRecord(111,"Karan");
  s2.insertRecord(222,"Aryan");

  s1.displayInformation();
  s2.displayInformation();

 }
}


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;

  @Test
  public void start() {


  }
  @BeforeClass
  public void startServer() {
   sel = new DefaultSelenium("localhost",4444,"*firefox","http://www.google.com");
   sel.start();
   try
   {
    sel.open("/");
    sel.waitForPageToLoad("30000");

   }
   catch(Exception e)
   {

   }
  }

  @AfterClass
  public void stopserver() {

   sel.close();
   sel.stop();
  }

}

Learning the API
Starting the Browser

setUp("http://www.google.com/", "*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.

Ads









Related Tutorials/Questions & Answers:
ModuleNotFoundError: No module named 'rc'
ModuleNotFoundError: No module named 'rc'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'rc' How to remove the ModuleNotFoundError: No module named 'rc' error
ModuleNotFoundError: No module named 'docopt-rc'
ModuleNotFoundError: No module named 'docopt-rc'  Hi, My Python... 'docopt-rc' How to remove the ModuleNotFoundError: No module named 'docopt-rc' error? Thanks   Hi, In your python environment you
Advertisements
ModuleNotFoundError: No module named 'docopt-rc'
ModuleNotFoundError: No module named 'docopt-rc'  Hi, My Python... 'docopt-rc' How to remove the ModuleNotFoundError: No module named 'docopt-rc' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'hamster-rc'
ModuleNotFoundError: No module named 'hamster-rc'  Hi, My Python... 'hamster-rc' How to remove the ModuleNotFoundError: No module named 'hamster-rc' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'nester-rc'
ModuleNotFoundError: No module named 'nester-rc'  Hi, My Python... 'nester-rc' How to remove the ModuleNotFoundError: No module named 'nester-rc' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'python-rc'
ModuleNotFoundError: No module named 'python-rc'  Hi, My Python... 'python-rc' How to remove the ModuleNotFoundError: No module named 'python-rc' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'rc-cli'
ModuleNotFoundError: No module named 'rc-cli'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'rc-cli' How to remove the ModuleNotFoundError: No module named 'rc-cli'
ModuleNotFoundError: No module named 'rc-client'
ModuleNotFoundError: No module named 'rc-client'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'rc-client' How to remove the ModuleNotFoundError: No module named 'rc
ModuleNotFoundError: No module named 'rc-cts'
ModuleNotFoundError: No module named 'rc-cts'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'rc-cts' How to remove the ModuleNotFoundError: No module named 'rc-cts'
ModuleNotFoundError: No module named 'rc-webserver'
ModuleNotFoundError: No module named 'rc-webserver'  Hi, My Python... 'rc-webserver' How to remove the ModuleNotFoundError: No module named 'rc-webserver' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'xcs-rc'
ModuleNotFoundError: No module named 'xcs-rc'  Hi, My Python...-rc' How to remove the ModuleNotFoundError: No module named 'xcs-rc'... to install padas library. You can install xcs-rc python with following command
ModuleNotFoundError: No module named 'django-modeldict-rc'
ModuleNotFoundError: No module named 'django-modeldict-rc'  Hi, My... named 'django-modeldict-rc' How to remove the ModuleNotFoundError: No module named 'django-modeldict-rc' error? Thanks   Hi
ModuleNotFoundError: No module named 'obs-ws-rc'
ModuleNotFoundError: No module named 'obs-ws-rc'  Hi, My Python... 'obs-ws-rc' How to remove the ModuleNotFoundError: No module named 'obs-ws-rc' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'odoo10-addon-l10n-it-fatturapa-in-rc'
ModuleNotFoundError: No module named 'odoo10-addon-l10n-it-fatturapa-in-rc...: ModuleNotFoundError: No module named 'odoo10-addon-l10n-it-fatturapa-in-rc' How...-in-rc' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'odoo10-addon-l10n-it-fatturapa-in-rc'
ModuleNotFoundError: No module named 'odoo10-addon-l10n-it-fatturapa-in-rc...: ModuleNotFoundError: No module named 'odoo10-addon-l10n-it-fatturapa-in-rc' How...-in-rc' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'odoo12-addon-l10n-it-fatturapa-in-rc'
ModuleNotFoundError: No module named 'odoo12-addon-l10n-it-fatturapa-in-rc...: ModuleNotFoundError: No module named 'odoo12-addon-l10n-it-fatturapa-in-rc' How...-in-rc' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'odoo12-addon-l10n-it-fatturapa-in-rc'
ModuleNotFoundError: No module named 'odoo12-addon-l10n-it-fatturapa-in-rc...: ModuleNotFoundError: No module named 'odoo12-addon-l10n-it-fatturapa-in-rc' How...-in-rc' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'rc-django-celery-results'
ModuleNotFoundError: No module named 'rc-django-celery-results'  Hi...: No module named 'rc-django-celery-results' How to remove the ModuleNotFoundError: No module named 'rc-django-celery-results' error? Thanks  
ModuleNotFoundError: No module named 'rc-server-sdk'
ModuleNotFoundError: No module named 'rc-server-sdk'  Hi, My... 'rc-server-sdk' How to remove the ModuleNotFoundError: No module named 'rc-server-sdk' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'rc-ssl-logtools'
ModuleNotFoundError: No module named 'rc-ssl-logtools'  Hi, My... named 'rc-ssl-logtools' How to remove the ModuleNotFoundError: No module named 'rc-ssl-logtools' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'sharp_aquos_rc'
ModuleNotFoundError: No module named 'sharp_aquos_rc'  Hi, My... named 'sharp_aquos_rc' How to remove the ModuleNotFoundError: No module named 'sharp_aquos_rc' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'sharp_aquos_rc'
ModuleNotFoundError: No module named 'sharp_aquos_rc'  Hi, My... named 'sharp_aquos_rc' How to remove the ModuleNotFoundError: No module named 'sharp_aquos_rc' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'Toaster-Secure-Scaffold-RC'
ModuleNotFoundError: No module named 'Toaster-Secure-Scaffold-RC'  Hi...: No module named 'Toaster-Secure-Scaffold-RC' How to remove the ModuleNotFoundError: No module named 'Toaster-Secure-Scaffold-RC' error? Thanks
ModuleNotFoundError: No module named 'Toaster-Secure-Scaffold-RC'
ModuleNotFoundError: No module named 'Toaster-Secure-Scaffold-RC'  Hi...: No module named 'Toaster-Secure-Scaffold-RC' How to remove the ModuleNotFoundError: No module named 'Toaster-Secure-Scaffold-RC' error? Thanks
ModuleNotFoundError: No module named 'Toaster-Secure-Scaffold-RC'
ModuleNotFoundError: No module named 'Toaster-Secure-Scaffold-RC'  Hi...: No module named 'Toaster-Secure-Scaffold-RC' How to remove the ModuleNotFoundError: No module named 'Toaster-Secure-Scaffold-RC' error? Thanks
Selenium-HP-Alm framework
Selenium-HP-Alm framework  selenium-hp-alm framework
ModuleNotFoundError: No module named 'selenium'
ModuleNotFoundError: No module named 'selenium'  Hi, My Python... 'selenium' How to remove the ModuleNotFoundError: No module named 'selenium... to install padas library. You can install selenium python with following
selenium maven dependency 3.7.1
selenium maven dependency 3.7.1  Hi, I am searching for selenium maven dependency 3.7.1 to add in my project. What is selenium maven dependency...;/groupId> <artifactId>selenium-java</artifactId> <
maven dependency for selenium
maven dependency for selenium  Hi, I am learning selenium for testing web application. I want to add library of selenium in Maven based Eclipse project. What is maven dependency for selenium? Thanks   Hi, Selenium
selenium maven dependency
selenium maven dependency  Hi, What is maven code for selenium maven...;org.seleniumhq.selenium</groupId> <artifactId>selenium-java<...; This will download all required libraries for selenium in your machine and include
selenium maven dependency
selenium maven dependency  Hi, What is maven code for selenium maven...;org.seleniumhq.selenium</groupId> <artifactId>selenium-java<...; This will download all required libraries for selenium in your machine and include

Ads