Top Banner
What is Automation Testing What is Automation Testing Automation testing use software or automation tool to create and execute test script which is written in scripting language for example java script. Automation testing Benefits : Automation tool save time when regression and Smoke test required. Automation tool run test case faster than human users. Automation tool help to address the load, stress and performance of the product. Automation tool improve software quality. Automation tool required less time and fewer resources .
33

Steps to write Selenium

Jul 18, 2015

Download

Technology

Rohit Thakur
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Steps to write Selenium

What is Automation Testing What is Automation Testing

Automation testing use software or automation tool to create and execute test script which is written in scripting language for example java script.

Automation testing Benefits :

Automation tool save time when regression and Smoke test required.

Automation tool run test case faster than human users.

Automation tool help to address the load, stress and performance of the product.

Automation tool improve software quality.

Automation tool required less time and fewer resources .

Page 2: Steps to write Selenium

Automation Tools Automation Tools

There are lot of testing tools available in the market and each tool is capable of doing specific testing such as functional and non functional testing. The automation tools that are widely used in functional and non functional testing.

Functional Testing tools

1)Quick Test Professional (Required licenses) 2)Selenium (Web Driver, Selenium RC) (Open Source)

Non Functional Tools 1) HP Loader( Required licenses) 2) Apache Jmeter (Open Source)

Page 3: Steps to write Selenium

Selenium –Functional Testing ToolSelenium –Functional Testing Tool

Selenium is a functional testing tool that automates web and mobile application with the help of web browsers like (Mozilla Firefox, Chrome, Internet explorer, Opera and Safari).

It is open source tool (freely available in Internet market) and support many language like HTML, Java/Script , Ruby, Python, C# etc.

Selenium provide record and play back feature and user can convert recorded script in any language.

Page 4: Steps to write Selenium

Component Used to Generate Manual Test ScriptComponent Used to Generate Manual Test Script

1.Selenium IDE is a Firefox add-on that provide record and playback feature and you can export or convert the recorded script in any languages like HTML, Java, .NET, Perl, Ruby and python You can run and customize script in the eclipse by adding Selenium web driver.

2.Selenium Web Driver 2.Selenium Web Driver is Application programming interface and collection of libraries. Using selenium web driver we can customize or edit script with the help of Eclipse frame-work .Each scripting language use specific web driver to generate and customize script for example C# language use Selenium .NET web driver and Visual studio framework to run and customize the script.

3.Eclipse is an integrated development environment (IDE) is used to develop test script. Eclipse framework support many languages like Java, Java script, Ruby, Python, C, C+, PL/SQL, Vb.net script.

Page 5: Steps to write Selenium

Steps to Add Selenium IDE Plug-in

Step 1: Open seleniumhq.org website in Mozilla Firefox ,Click on download tab

and Click Version 2.6.0 link to install plug-in.

Page 6: Steps to write Selenium

Selenium ask you to install following items

Page 7: Steps to write Selenium

Restart Mozilla Firefox Web Browser

Page 8: Steps to write Selenium

Verify all language formatter Installed Properly Click on Tool menu – Add-on

Page 9: Steps to write Selenium

Open website in Mozilla Firefox

Open Mozilla Firefox enter web site URL in the URL Box of Mozilla

Page 10: Steps to write Selenium

Steps to Record Test Script Using Selenium IDE Steps to Record Test Script Using Selenium IDE

Step 1: Click on tools menu then click Selenium IDE option a pop will appear as given below

Step:3: Enter base URL and minimize selenium IDE Pop

Page 11: Steps to write Selenium

Visit Website to Record ScriptVisit Website to Record Script

Page 12: Steps to write Selenium

Maximize Sel. IDE Pop Up & Stop Recording Maximize Sel. IDE Pop Up & Stop Recording

Execution Commands

Stop Recording

Reference of the currently selected command

Page 13: Steps to write Selenium

Change HTML Default Recording Mode To ScriptingChange HTML Default Recording Mode To Scripting

Click on option menu to select scripting language option

Page 14: Steps to write Selenium

Enable Scripting Language OptionEnable Scripting Language Option

You need to check mark this option

Page 15: Steps to write Selenium

Now Convert HTML to Java Script Now Convert HTML to Java Script

Click on web driver

Page 16: Steps to write Selenium

On Click J-Unit Web Driver a Pop Will Appear On Click J-Unit Web Driver a Pop Will Appear

Click ok button

Page 17: Steps to write Selenium

On Click Ok Button HTML Code Converted to Java ScriptOn Click Ok Button HTML Code Converted to Java Script

Copy this Code

Page 18: Steps to write Selenium

Open Eclipse to Run Java Script Open Eclipse to Run Java Script

Steps: 1 Open adt (Eclipse) folder saved in your hard disk. Steps: 2 Click on Eclipse icon.Steps: 3 Splash Screen will appear with Dialog box To choose location to save your script

Steps:4 Click on Ok button eclipse will be open

Page 19: Steps to write Selenium

Create Project in the Eclipse Create Project in the Eclipse

Steps Click on file menu . Click on new . Then click project

Page 20: Steps to write Selenium

Give name to your project Give name to your project

Steps : Give name to project then click next button

Page 21: Steps to write Selenium

Define the Java Build Setting Define the Java Build Setting

Page 22: Steps to write Selenium

Add Selenium Web Driver to Click Library Tab Add Selenium Web Driver to Click Library Tab

Page 23: Steps to write Selenium

Click on Add External JARS..Click on Add External JARS..

Page 24: Steps to write Selenium

Verify Jars files will attached with Java Build Verify Jars files will attached with Java Build

Page 25: Steps to write Selenium

Open Project Explorer to See Java Build Open Project Explorer to See Java Build

Page 26: Steps to write Selenium

Right Click On Project to Add Class fileRight Click On Project to Add Class file

Page 27: Steps to write Selenium

Give Name To Class file Give Name To Class file

Step 1:Give name to class file . Choose Method Click on Finish button a class file will appear

Page 28: Steps to write Selenium

Remove Code from class file and Past Sel. IDE Script Remove Code from class file and Past Sel. IDE Script

Page 29: Steps to write Selenium

Edit and Run Recorded Script Edit and Run Recorded Script

Page 30: Steps to write Selenium

Choose Launcher to Run ScriptChoose Launcher to Run Script

Page 31: Steps to write Selenium

Save and Launch Resource Save and Launch Resource

Page 32: Steps to write Selenium

Output of Java Script Output of Java Script

Page 33: Steps to write Selenium

The End The End

Prepared byPrepared by

Rohit thakur Rohit thakur