SlideShare a Scribd company logo
1 of 13
Download to read offline
Selenium For Beginners
Manjyot Singh
Raman Kansal
Workshop
Why To Automate
Selenium Introduction
In 2004 Jason Huggins developed JavaScript Library which
became Selenium Core
Open Source
Selenium IDE, Selenium RC, Selenium Grid, Selenium
WebDriver
WebDriver Introduction
In 2006 Simon Stewart started work on WebDriver
Directly speaks to browser using the native methods of browser and
OS
Object Oriented API
Selenium 2 = WebDriver + Selenium RC
Power Of Selenium 2
Setup
Verify Software Installation
Import Selenium Jars in IntelliJ
Create Sample Project
Basic Selenium2 Workshop – Session 1
What is DOM (Document Object Model)
How to find element in DOM
Automate Registration Form
Page Object Patterns
What is Page Object Pattern
Layer of Abstraction
Is a Java Class representing a Web Page
POM
Challenges
Unmaintainable code.
Duplicate code.
Not able to track changes.
End result
DRY(Do not repeat yourself)
Improves readability.
Less key strokes.
Basic Selenium2 Workshop – Session 2
Implement Page factory
In-build page object model for selenium webdriver.
Concept of separation of Page objects and Test methods.
@FindBy – Finding web elements.
InitElements() - Initialize web elements.
Implement Page Object Pattern
Sample Code Snippet
lpublic class LoginPage
{
//Locators assigned to variables
@FindBy(how = How.ID, using = “password")
private static WebElement passwordTextField = null;
@FindBy(how = How.NAME, using = “username")
private static WebElement userNameTextField = null;
@FindBy(how = How.XPATH, using = "//input[@name=‘loginButton’]")
private static WebElement loginButton = null;
//Expose methods
public HomePage login(String userName, String password )
{
userNameTextField.sendKeys(userName);
passwordTextField.sendKeys(password);
loginButton.click();
return new HomePage();
}
}
//Calling
LoginPage loginObj = new LoginPage();
HomePage homeObj = loginObj.login(“user”,”password”);
Home Page
Login
Login Page
Questions

More Related Content

What's hot

Choosing the best JavaScript framework/library/toolkit
Choosing the best JavaScript framework/library/toolkitChoosing the best JavaScript framework/library/toolkit
Choosing the best JavaScript framework/library/toolkitHristo Chakarov
 
Testing Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS CurriculumTesting Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS CurriculumBrian Jordan
 
On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)Zoe Landon
 
Creating books app with react native
Creating books app with react nativeCreating books app with react native
Creating books app with react nativeAli Sa'o
 
APIs: A Better Alternative to Page Objects
APIs: A Better Alternative to Page ObjectsAPIs: A Better Alternative to Page Objects
APIs: A Better Alternative to Page ObjectsSauce Labs
 
Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?TechMagic
 
Better End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using ProtractorBetter End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using ProtractorKasun Kodagoda
 
AngularJS + React
AngularJS + ReactAngularJS + React
AngularJS + Reactjustvamp
 
Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)Devin Abbott
 
Statistical Element Locator by Oren Rubin - SeleniumConf UK 2016
Statistical Element Locator by Oren Rubin - SeleniumConf UK 2016Statistical Element Locator by Oren Rubin - SeleniumConf UK 2016
Statistical Element Locator by Oren Rubin - SeleniumConf UK 2016Oren Rubin
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternSargis Sargsyan
 
DSL, Page Object and Selenium – a way to reliable functional tests
DSL, Page Object and Selenium – a way to reliable functional testsDSL, Page Object and Selenium – a way to reliable functional tests
DSL, Page Object and Selenium – a way to reliable functional testsMikalai Alimenkou
 
Selenium webdriver
Selenium webdriverSelenium webdriver
Selenium webdriversean_todd
 

What's hot (20)

Angular 2 vs React
Angular 2 vs ReactAngular 2 vs React
Angular 2 vs React
 
Sfk13
Sfk13Sfk13
Sfk13
 
Choosing the best JavaScript framework/library/toolkit
Choosing the best JavaScript framework/library/toolkitChoosing the best JavaScript framework/library/toolkit
Choosing the best JavaScript framework/library/toolkit
 
React Native
React NativeReact Native
React Native
 
Testing Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS CurriculumTesting Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS Curriculum
 
Kickstart sencha extjs
Kickstart sencha extjsKickstart sencha extjs
Kickstart sencha extjs
 
On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)
 
Creating books app with react native
Creating books app with react nativeCreating books app with react native
Creating books app with react native
 
APIs: A Better Alternative to Page Objects
APIs: A Better Alternative to Page ObjectsAPIs: A Better Alternative to Page Objects
APIs: A Better Alternative to Page Objects
 
Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?
 
Better End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using ProtractorBetter End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using Protractor
 
AngularJS + React
AngularJS + ReactAngularJS + React
AngularJS + React
 
The Future of ASP.NET
The Future of ASP.NETThe Future of ASP.NET
The Future of ASP.NET
 
Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)
 
Statistical Element Locator by Oren Rubin - SeleniumConf UK 2016
Statistical Element Locator by Oren Rubin - SeleniumConf UK 2016Statistical Element Locator by Oren Rubin - SeleniumConf UK 2016
Statistical Element Locator by Oren Rubin - SeleniumConf UK 2016
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
 
DSL, Page Object and Selenium – a way to reliable functional tests
DSL, Page Object and Selenium – a way to reliable functional testsDSL, Page Object and Selenium – a way to reliable functional tests
DSL, Page Object and Selenium – a way to reliable functional tests
 
Selenium webdriver
Selenium webdriverSelenium webdriver
Selenium webdriver
 
Web driver training
Web driver trainingWeb driver training
Web driver training
 
Selenium. going beyond the possible
Selenium. going beyond the possibleSelenium. going beyond the possible
Selenium. going beyond the possible
 

Viewers also liked

Beginner's guide to git
Beginner's guide to gitBeginner's guide to git
Beginner's guide to gitLim Sim
 
Beginner's guide to Selenium
Beginner's guide to SeleniumBeginner's guide to Selenium
Beginner's guide to SeleniumLim Sim
 
Selenium ide material (1)
Selenium ide material (1)Selenium ide material (1)
Selenium ide material (1)Sriram Angajala
 
LoadUI web performance testing tool
LoadUI web performance testing toolLoadUI web performance testing tool
LoadUI web performance testing toolMilind Rupchandani
 
First steps with selenium rc
First steps with selenium rcFirst steps with selenium rc
First steps with selenium rcDang Nguyen
 
Selenium IDE Introduction, Installation and Working
Selenium IDE Introduction, Installation and WorkingSelenium IDE Introduction, Installation and Working
Selenium IDE Introduction, Installation and WorkingDisha Srivastava
 
selenium training | selenium course | selenium video tutorial | selenium for ...
selenium training | selenium course | selenium video tutorial | selenium for ...selenium training | selenium course | selenium video tutorial | selenium for ...
selenium training | selenium course | selenium video tutorial | selenium for ...Nancy Thomas
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With SeleniumDeepak Mittal
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with SeleniumKerry Buckley
 
Selenium 2 - PyCon 2011
Selenium 2 - PyCon 2011Selenium 2 - PyCon 2011
Selenium 2 - PyCon 2011hugs
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)Sauce Labs
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics TutorialClever Moe
 
Selenium Tips & Tricks
Selenium Tips & TricksSelenium Tips & Tricks
Selenium Tips & TricksDave Haeffner
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Seleniumvivek_prahlad
 
Java Basics for selenium
Java Basics for seleniumJava Basics for selenium
Java Basics for seleniumapoorvams
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using SeleniumNaresh Chintalcheru
 

Viewers also liked (20)

Beginner's guide to git
Beginner's guide to gitBeginner's guide to git
Beginner's guide to git
 
Beginner's guide to Selenium
Beginner's guide to SeleniumBeginner's guide to Selenium
Beginner's guide to Selenium
 
Selenium with java
Selenium with javaSelenium with java
Selenium with java
 
Selenium ide material (1)
Selenium ide material (1)Selenium ide material (1)
Selenium ide material (1)
 
LoadUI web performance testing tool
LoadUI web performance testing toolLoadUI web performance testing tool
LoadUI web performance testing tool
 
First steps with selenium rc
First steps with selenium rcFirst steps with selenium rc
First steps with selenium rc
 
Selenium IDE Introduction, Installation and Working
Selenium IDE Introduction, Installation and WorkingSelenium IDE Introduction, Installation and Working
Selenium IDE Introduction, Installation and Working
 
selenium training | selenium course | selenium video tutorial | selenium for ...
selenium training | selenium course | selenium video tutorial | selenium for ...selenium training | selenium course | selenium video tutorial | selenium for ...
selenium training | selenium course | selenium video tutorial | selenium for ...
 
Selenium web driver in Java
Selenium web driver in JavaSelenium web driver in Java
Selenium web driver in Java
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With Selenium
 
Foundation selenium java
Foundation selenium java Foundation selenium java
Foundation selenium java
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with Selenium
 
Selenium 2 - PyCon 2011
Selenium 2 - PyCon 2011Selenium 2 - PyCon 2011
Selenium 2 - PyCon 2011
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics Tutorial
 
Selenium Tips & Tricks
Selenium Tips & TricksSelenium Tips & Tricks
Selenium Tips & Tricks
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Selenium
 
Java Basics for selenium
Java Basics for seleniumJava Basics for selenium
Java Basics for selenium
 
Introduction to Selenium Web Driver
Introduction to Selenium Web DriverIntroduction to Selenium Web Driver
Introduction to Selenium Web Driver
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
 

Similar to Selenium_For_Beginners_VodQA_Final

Getting started with Selenium 2
Getting started with Selenium 2Getting started with Selenium 2
Getting started with Selenium 2Sebastiano Armeli
 
Selenium training12 1
Selenium training12 1Selenium training12 1
Selenium training12 1AmanCSE1
 
Selenium training-course-content
Selenium training-course-contentSelenium training-course-content
Selenium training-course-contentAmanCSE1
 
Selenium training12 1
Selenium training12 1Selenium training12 1
Selenium training12 1AmanCSE1
 
selenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdfselenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdfAnuragMourya8
 
Selenium withnet
Selenium withnetSelenium withnet
Selenium withnetVlad Maniak
 
Automation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra SolutionsAutomation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra SolutionsQuontra Solutions
 
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...Atirek Gupta
 
Selenium training-course-content-syllabus-credo systemz
Selenium training-course-content-syllabus-credo systemzSelenium training-course-content-syllabus-credo systemz
Selenium training-course-content-syllabus-credo systemzTraining Institute
 
Pdx Se Intro To Se
Pdx Se Intro To SePdx Se Intro To Se
Pdx Se Intro To SeAn Doan
 
Upcoming new features of selenium in automation testing
Upcoming new features of selenium in automation testingUpcoming new features of selenium in automation testing
Upcoming new features of selenium in automation testingsoftware testingchennai
 
Selenium course training institute ameerpet hyderabad
Selenium course training institute ameerpet hyderabadSelenium course training institute ameerpet hyderabad
Selenium course training institute ameerpet hyderabadSathya Technologies
 
Selenium course training institute ameerpet hyderabad – Best software trainin...
Selenium course training institute ameerpet hyderabad – Best software trainin...Selenium course training institute ameerpet hyderabad – Best software trainin...
Selenium course training institute ameerpet hyderabad – Best software trainin...Sathya Technologies
 
Selenium webdriver course content rakesh hansalia
Selenium webdriver course content rakesh hansaliaSelenium webdriver course content rakesh hansalia
Selenium webdriver course content rakesh hansaliaRakesh Hansalia
 
Tech talks (Automation on Selenium Web Driver. How to begin & implement)
Tech talks (Automation on Selenium Web Driver. How to begin & implement)Tech talks (Automation on Selenium Web Driver. How to begin & implement)
Tech talks (Automation on Selenium Web Driver. How to begin & implement)Taras Lytvyn
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersAjit Jadhav
 
Stanislaw potoczny kra_qa_21.01.20
Stanislaw potoczny kra_qa_21.01.20Stanislaw potoczny kra_qa_21.01.20
Stanislaw potoczny kra_qa_21.01.20kraqa
 

Similar to Selenium_For_Beginners_VodQA_Final (20)

Getting started with Selenium 2
Getting started with Selenium 2Getting started with Selenium 2
Getting started with Selenium 2
 
Selenium training12 1
Selenium training12 1Selenium training12 1
Selenium training12 1
 
Selenium training-course-content
Selenium training-course-contentSelenium training-course-content
Selenium training-course-content
 
Selenium training12 1
Selenium training12 1Selenium training12 1
Selenium training12 1
 
selenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdfselenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdf
 
Selenium withnet
Selenium withnetSelenium withnet
Selenium withnet
 
Automation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra SolutionsAutomation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra Solutions
 
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
 
Selenium training-course-content-syllabus-credo systemz
Selenium training-course-content-syllabus-credo systemzSelenium training-course-content-syllabus-credo systemz
Selenium training-course-content-syllabus-credo systemz
 
Pdx Se Intro To Se
Pdx Se Intro To SePdx Se Intro To Se
Pdx Se Intro To Se
 
Upcoming new features of selenium in automation testing
Upcoming new features of selenium in automation testingUpcoming new features of selenium in automation testing
Upcoming new features of selenium in automation testing
 
Selenium slide
Selenium slideSelenium slide
Selenium slide
 
Selenium course training institute ameerpet hyderabad
Selenium course training institute ameerpet hyderabadSelenium course training institute ameerpet hyderabad
Selenium course training institute ameerpet hyderabad
 
Selenium course training institute ameerpet hyderabad – Best software trainin...
Selenium course training institute ameerpet hyderabad – Best software trainin...Selenium course training institute ameerpet hyderabad – Best software trainin...
Selenium course training institute ameerpet hyderabad – Best software trainin...
 
Selenium webdriver course content rakesh hansalia
Selenium webdriver course content rakesh hansaliaSelenium webdriver course content rakesh hansalia
Selenium webdriver course content rakesh hansalia
 
Tech talks (Automation on Selenium Web Driver. How to begin & implement)
Tech talks (Automation on Selenium Web Driver. How to begin & implement)Tech talks (Automation on Selenium Web Driver. How to begin & implement)
Tech talks (Automation on Selenium Web Driver. How to begin & implement)
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And Answers
 
Stanislaw potoczny kra_qa_21.01.20
Stanislaw potoczny kra_qa_21.01.20Stanislaw potoczny kra_qa_21.01.20
Stanislaw potoczny kra_qa_21.01.20
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 

Selenium_For_Beginners_VodQA_Final

  • 1. Selenium For Beginners Manjyot Singh Raman Kansal Workshop
  • 3. Selenium Introduction In 2004 Jason Huggins developed JavaScript Library which became Selenium Core Open Source Selenium IDE, Selenium RC, Selenium Grid, Selenium WebDriver
  • 4. WebDriver Introduction In 2006 Simon Stewart started work on WebDriver Directly speaks to browser using the native methods of browser and OS Object Oriented API Selenium 2 = WebDriver + Selenium RC
  • 6.
  • 7. Setup Verify Software Installation Import Selenium Jars in IntelliJ Create Sample Project
  • 8. Basic Selenium2 Workshop – Session 1 What is DOM (Document Object Model) How to find element in DOM Automate Registration Form
  • 9. Page Object Patterns What is Page Object Pattern Layer of Abstraction Is a Java Class representing a Web Page
  • 10. POM Challenges Unmaintainable code. Duplicate code. Not able to track changes. End result DRY(Do not repeat yourself) Improves readability. Less key strokes.
  • 11. Basic Selenium2 Workshop – Session 2 Implement Page factory In-build page object model for selenium webdriver. Concept of separation of Page objects and Test methods. @FindBy – Finding web elements. InitElements() - Initialize web elements. Implement Page Object Pattern
  • 12. Sample Code Snippet lpublic class LoginPage { //Locators assigned to variables @FindBy(how = How.ID, using = “password") private static WebElement passwordTextField = null; @FindBy(how = How.NAME, using = “username") private static WebElement userNameTextField = null; @FindBy(how = How.XPATH, using = "//input[@name=‘loginButton’]") private static WebElement loginButton = null; //Expose methods public HomePage login(String userName, String password ) { userNameTextField.sendKeys(userName); passwordTextField.sendKeys(password); loginButton.click(); return new HomePage(); } } //Calling LoginPage loginObj = new LoginPage(); HomePage homeObj = loginObj.login(“user”,”password”); Home Page Login Login Page