Archive for August 2nd, 2013

Start the Selenium Standalone Server

Start the Selenium Standalone Server

Pre-requisites:

Before running or starting the selenium standalone server , please ensure that you have already configured the Selenium Standalone Server in Eclipse IDE (i.e. As explained in our previous post on link https://dennosecqtinstien.wordpress.com/2013/08/02/configuring-selenium-standalone-server-in-eclipse-ide/)

Steps to Start the Selenium Standalone Server:

1. Click on ‘Configured Run’ icon on Eclipse IDE as shown below and select ‘Selenium Standalone Server’ option (We have given this name while configuring the Run Setup – Refer Above Step – 3):

2. Ensure that the Selenium Standalone Server has launched and started in Console as shown below:

Thats it !!! This is how we start the Selenium Standalone Server.

Advertisements

Configuring Selenium Standalone Server in Eclipse IDE

Configuring Selenium Standalone Server in Eclipse IDE

Before running any Test written in Selenium RC on Eclipse IDE, we’ve to start the Selenium Server first.
In order to start the selenium sever, first we have to configure its Run setup in Eclipse IDE as explained below:
1. In Eclipse IDE, click on the ‘Run’ Menu and select ‘External Tools’ -> ‘External Tools Configurations’ option as shown below:

2. Ensure that ‘External Tools Configurations’ dialog is displayed, select ‘Program’ option and click on ‘New Launch Configuration’ option as shown below:

3. Ensure ‘New Launch Configuration’ options are displayed and change the name in the Name field to “Selenium Standalone Server” as shown below:

4. Click on the ‘Browse File System’ button under the ‘Location’ heading as shown below:

5. Select the Java.exe  file inside the ‘bin’ folder of  C:/Program Files/Java/JDK path as shown below and click on ‘Open’ button:

6. Ensure that the selected ‘Java.exe’ file path got added in the ‘Location’ text box as shown below:

7. Click on ‘Brows Workspace’ button under the ‘Working Directory’ as shown below:

8. Ensure ‘Folder Selection’ dialog is displayed, expand the ‘Project’ folder, select the ‘library’ folder and click on ‘OK’ button as shown below:

9. Ensure that the selected ‘library’ work space path got added into the ‘Working Directory’ text box as shown below:

10. Enter ‘-jar selenium-standalone-server-2.31.0.jar’ command into the ‘Arguments’ text area as shown below:

11. Click on ‘Apply’ Button as shown below:

12. Click on ‘Run’ button as shown below:

13. Ensure that the Selenium Standalone Server has launched and started in Console as shown below:

Configure Projects in Eclipse IDE to work with Selenium RC

Configure Projects in Eclipse IDE to work with Selenium RC

1. Create a Project in Eclipse IDE

1. Install Eclipse IDE
2. Launch Eclipse IDE
3. Create a Project in Eclipse IDE

2. Adding Java Client Drivers (i.e. .jar files) in the ‘selenium-remote-control-1.0.8’ extracted folder to the Project created in Eclipse IDE

1. Right click on the Project and select ‘New’ -> ‘Folder’ option as shown below:

2. Ensure ‘New Folder’ dialog is displayed, specify the folder name as ‘library’ and click on ‘Finish’ button as shown below:

3. Ensure whether ‘library’ folder in added to the Project under ‘Package Explorer’ as shown below:

4. Go the Folder where we have extracted the ‘selenium-remote-control-1.0.3.zip’ folder in our previous post as shown below:

 

5. Open the Extracted Folder and ensure that ‘selenium-java-client-driver-1.0.1’  folder exists as shown below:

6. Open the ‘selenium-java-client-driver-1.0.1’ folder and ensure that there are four .jar files as shown below:

7. Copy these four .jar files as shown below:

8. In Eclipse IDE, select ‘libraries’ folder and paste the copied .jar files as shown below:

9. Ensure that all the copied .jar files got pasted as shown below:

3. Adding Selenium-Server-Standalone-Version.JAR file to the Project in Eclipse IDE

1. Go to the folder where the downloaded ‘selenium-standalone-server-version.jar’ file is available as shown below: (i.e. downloaded in our previous post)

2. Copy the ‘selenium-server-standalone-version.jar’ file as shown below:

3. In Eclipse IDE, select the ‘library’ folder and paste the copied .jar file as shown below:

4. Ensure that the copied .jar got pasted under the ‘library’ folder as shown below:

4. Configuring the copied JAR files in Eclipse IDE

1. Right click on the Project and select ‘Properties’ option as shown below:

2. In ‘Properties for Project’ dialog, select ‘Java Build Path’ option as shown below:

3. Select ‘Libraries’ tab as shown below:

4. Click on ‘Add JARs’ butt under the ‘Libraries’ tab as shown below:

5. In ‘JAR Selection’ dialog, select the all the JAR Files copied under ‘library’ folder and click on ‘OK’ button as shown below:

6. Ensure that all the JAR files got added in the properties dialog and click on ‘OK’ button as shown below:

Thats it !!! Now you have configured your project with all the JAR files that are required for working with Selenium RC Code.

Introduction to Selenium RC (i.e. Selenium 1)

Introduction to Selenium RC (i.e. Selenium 1)

 

Selenium RC alias Selenium Remote Control alias Selenium 1 is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website.

Selenium RC is one of the most popular flavors of Selenium as it allows test developers to write tests using their favorite language to test on different browsers.

Pre-requisites for Selenium RC:

  • Selenium IDE – These will be described later in the posts
  • Java – These will be described later in the posts
  • Eclipse IDE – These will be described later in the posts

What is Selenium RC ?

  • Selenium RC allows you to write Automation tests in any supported programming language (say Java).
  • Selenium RC is also known as Selenium Remote Control and Selenium 1.
  • Selenium RC is an open source and free tool.
  • Selenium RC was the main Selenium Project for long time (i.e. Currently Selenium 2 is the main project). Selenium 2 still runs Selenium 1’s Selenium RC interface for backwards compatibility.
  • Selenium RC has support for almost all browsers
  • Selenium RC has support for several programming languages like Java, C#, Ruby, Python, Pearl, Javascript and PHP)

How Selenium RC works?

Selenium RC comes in two parts:

  • Server which handles the browsers
  • Client Driver for computer language

Selenium RC is the server version of Selenium. You write your tests using a programming language (say Java) and client driver for the programming language. Your tests issues commands, which the client driver sends to the server. The server then performs your actions for you in the browser and reports the results back to your client.

After looking into the above screenshot, its very clear that The client sends the commands to the server and the server runs the commands to drive the browser. Finally the server sends back the results observed on driving the browser to the client.

Selenium RC Server acts as a Proxy:

Due to the security reasons with the Browsers, the website content cannot be accessible by any script from external site. Hence we require a Selenium RC Server which acts as a proxy by taking the script written for automating the web application as input and performing the operations as written in the script on browsers as output as shown below:

The Process of Running Tests using Selenium RC:

1. Suppose you have written Selenium Automation Tests to be performed on any Application in Java Language. The Selenium Automation Tests consists of Selenium Commands which are programmed using Java language.
2. Since we are using Java language, we have to use Java Client Drivers to communicate the Selenium Commands with the Selenium RC server which acts a proxy to avoid security restrictions of any browser.
3. When a test starts, the following happens:

1) The client driver establishes a connection with the Selenium RC server.
2) Selenium RC server launches a browser with a URL specified in the Automation code.
3) The Client driver passes a Selenium command to the Selenium RC Server
4) The Selenium RC Server interprets the command and then triggers the corresponding JavaScript execution to execute that command within the browser.
5) Once all the Selenium Commands got executed, the Selenium RC server closes the browser
6) Selenium RC server communicates the results with the Client driver
7) Hence the Test results are displayed on the Client side.

So to conclude the Selenium RC server acts as a mediator/proxy between the Selenium Code written in any programming language and Browsers with security to resolve the security problems.

To understand more about How the Selenium RC works please go through the following link:
http://docs.seleniumhq.org/projects/remote-control/

%d bloggers like this: