際際滷

際際滷Share a Scribd company logo
RBS54273
2
RBS54273
History
 2004, ThoughtWorks, Chicago, Jason Huggins, Core code.
 Shinya Kasatani, ThoughtWorks, Japan, Selenium IDE.
 Jason Huggins, left ThoughtWorks, 2007.
 Jennifer Bevan & Jason Huggins, Google, Worked on RC.
 Simon Stewart, ThoughtWorks, WebDriver.
3
RBS54273
What
 Framework that runs in your web-browser and in headless mode.
 Hooks for many other languages.
Java, Ruby, Python, C# etc
 Simulate a user navigating through pages and then assert for specific marks
on the pages.
 Antidote to Mercury poisoning.
4
RBS54273
Types
 IDE
 RC  Selenium 1
 Webdriver  Selenium 2
 Grid
5
RBS54273
Why
 Open source.
 Supports multiple languages.
 Cross browser support.
 Cross OS support.
 Runs in both headless and browser mode.
 Parallel execution.
 CI compatible.
 Unit testing framework support like Junit, TestNG, NUnit, Rspec etc.
 Mobile testing support using Android, IPhone, IPad & Blackberry drivers etc.
6
RBS54273
Locators
 ID
id=textId
 Name
name=textName
 CSS
css=em
 XPATH
Relative (//div[@id=123]/span)
Absolute (/html/body/div[1])
7
RBS54273
IDE
8
RBS54273
IDE Cont-d
9
RBS54273
IDE Cont-d
10
RBS54273
RC
11
RBS54273
WebDriver
12
RBS54273
RC Vs WebDriver
13
RBS54273
RC Vs WebDriver Cont-d
14
RBS54273
Page object model
 Challenge
Unmaintainable project.
Duplicated code.
Not easy to track changes.
 Solution
Use Page object model.
 About
All page specific elements/ methods has to be extracted to separate classes.
Eliminates duplication.
Improves readability.
 Less key strokes.
15
RBS54273
P.O.M Cont-d
public 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();
}
}
Then in any test class we can call above function like :
LoginPage loginPage=new LoginPage();
HomePage homePage=loginPage.login(singmaz,pass123#);
16
RBS54273
Grid
17
RBS54273
Grid - console
18
RBS54273
Steps
1) java -jar selenium-server-standalone-2.14.0.jar -role hub (by default it registers at
4444)
2) Open the browser and run the following URL http://localhost:4444/console
3) Open the command prompt at node1 and go to the directory selenium-grid-1.0.8-
binselenium-grid-1.0.8
4) Type : java -jar selenium-server-standalone-2.14.0.jar -role node -Dport=5555
-Dhost=192.168.1.149 -DhubURL=http://192.168.1.25:4444 -Denvironment=*firefox
launch-remote-control
5) Similarly for node2.noden
6) Everything is sorted.
19
RBS54273
20
RBS54273
Ad

Recommended

Selenium_For_Beginners_VodQA_Final
Selenium_For_Beginners_VodQA_Final
Manjyot Singh
Build Tools-Introduction (3)
Build Tools-Introduction (3)
Manjyot Singh
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Deepu S Nath
React native-meetup-talk
React native-meetup-talk
kiranabburi
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
Srijan Technologies
仍亠从亠亶 仂仍从仂于 "于亠亟亠仆亳亠 于 React Native"
仍亠从亠亶 仂仍从仂于 "于亠亟亠仆亳亠 于 React Native"
Fwdays
Choosing the best JavaScript framework/library/toolkit
Choosing the best JavaScript framework/library/toolkit
Hristo Chakarov
React Native
React Native
Huqiu Liao
仍亠从舒仆亟 丱仂亠仄从亳亶 ProtractorJS 磻 仆仄亠仆 弍舒亰亠仆仂 舒于仂仄舒亳亰舒 亟仍...
仍亠从舒仆亟 丱仂亠仄从亳亶 ProtractorJS 磻 仆仄亠仆 弍舒亰亠仆仂 舒于仂仄舒亳亰舒 亟仍...
Dakiry
JS Framework Comparison - An infographic
JS Framework Comparison - An infographic
InApp
On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)
Zoe Landon
Real World Web components
Real World Web components
Jarrod Overson
ITT Flisol 2013
ITT Flisol 2013
Domingo Suarez Torres
Selenium testing
Selenium testing
Jason Myers
React Component Library Design @WalmartLabs
React Component Library Design @WalmartLabs
chaseadamsio
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
MarkupBox
jQuery Conference 2012 keynote
jQuery Conference 2012 keynote
dmethvin
Angular 2 vs React
Angular 2 vs React
Iran Reyes Fleitas
Natural Language UI Testing using Behavior Driven Development with Pavlov and...
Natural Language UI Testing using Behavior Driven Development with Pavlov and...
Eric DeLabar
Top java script frameworks ppt
Top java script frameworks ppt
Omkarsoft Bangalore
SGCE 2012 Lightning Talk-Single Page Interface
SGCE 2012 Lightning Talk-Single Page Interface
Domingo Suarez Torres
React Native
React Native
Artyom Trityak
Latest Javascript MVC & Front End Frameworks 2017
Latest Javascript MVC & Front End Frameworks 2017
AmarInfotech
Mvvm knockout vs angular
Mvvm knockout vs angular
Basarat Syed
AngularJS is awesome
AngularJS is awesome
Eusebiu Schipor
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
Goutam Dey
React mini lecture
React mini lecture
Ilia Lobsanov
Building great spas with angular js, asp.net mvc and webapi
Building great spas with angular js, asp.net mvc and webapi
Maurice De Beijer [MVP]
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Dave Haeffner
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
Sauce Labs

More Related Content

What's hot (20)

仍亠从舒仆亟 丱仂亠仄从亳亶 ProtractorJS 磻 仆仄亠仆 弍舒亰亠仆仂 舒于仂仄舒亳亰舒 亟仍...
仍亠从舒仆亟 丱仂亠仄从亳亶 ProtractorJS 磻 仆仄亠仆 弍舒亰亠仆仂 舒于仂仄舒亳亰舒 亟仍...
Dakiry
JS Framework Comparison - An infographic
JS Framework Comparison - An infographic
InApp
On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)
Zoe Landon
Real World Web components
Real World Web components
Jarrod Overson
ITT Flisol 2013
ITT Flisol 2013
Domingo Suarez Torres
Selenium testing
Selenium testing
Jason Myers
React Component Library Design @WalmartLabs
React Component Library Design @WalmartLabs
chaseadamsio
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
MarkupBox
jQuery Conference 2012 keynote
jQuery Conference 2012 keynote
dmethvin
Angular 2 vs React
Angular 2 vs React
Iran Reyes Fleitas
Natural Language UI Testing using Behavior Driven Development with Pavlov and...
Natural Language UI Testing using Behavior Driven Development with Pavlov and...
Eric DeLabar
Top java script frameworks ppt
Top java script frameworks ppt
Omkarsoft Bangalore
SGCE 2012 Lightning Talk-Single Page Interface
SGCE 2012 Lightning Talk-Single Page Interface
Domingo Suarez Torres
React Native
React Native
Artyom Trityak
Latest Javascript MVC & Front End Frameworks 2017
Latest Javascript MVC & Front End Frameworks 2017
AmarInfotech
Mvvm knockout vs angular
Mvvm knockout vs angular
Basarat Syed
AngularJS is awesome
AngularJS is awesome
Eusebiu Schipor
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
Goutam Dey
React mini lecture
React mini lecture
Ilia Lobsanov
Building great spas with angular js, asp.net mvc and webapi
Building great spas with angular js, asp.net mvc and webapi
Maurice De Beijer [MVP]
仍亠从舒仆亟 丱仂亠仄从亳亶 ProtractorJS 磻 仆仄亠仆 弍舒亰亠仆仂 舒于仂仄舒亳亰舒 亟仍...
仍亠从舒仆亟 丱仂亠仄从亳亶 ProtractorJS 磻 仆仄亠仆 弍舒亰亠仆仂 舒于仂仄舒亳亰舒 亟仍...
Dakiry
JS Framework Comparison - An infographic
JS Framework Comparison - An infographic
InApp
On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)
Zoe Landon
Real World Web components
Real World Web components
Jarrod Overson
Selenium testing
Selenium testing
Jason Myers
React Component Library Design @WalmartLabs
React Component Library Design @WalmartLabs
chaseadamsio
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
MarkupBox
jQuery Conference 2012 keynote
jQuery Conference 2012 keynote
dmethvin
Natural Language UI Testing using Behavior Driven Development with Pavlov and...
Natural Language UI Testing using Behavior Driven Development with Pavlov and...
Eric DeLabar
Top java script frameworks ppt
Top java script frameworks ppt
Omkarsoft Bangalore
SGCE 2012 Lightning Talk-Single Page Interface
SGCE 2012 Lightning Talk-Single Page Interface
Domingo Suarez Torres
Latest Javascript MVC & Front End Frameworks 2017
Latest Javascript MVC & Front End Frameworks 2017
AmarInfotech
Mvvm knockout vs angular
Mvvm knockout vs angular
Basarat Syed
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
Goutam Dey
React mini lecture
React mini lecture
Ilia Lobsanov
Building great spas with angular js, asp.net mvc and webapi
Building great spas with angular js, asp.net mvc and webapi
Maurice De Beijer [MVP]

Similar to Selenium (20)

Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Dave Haeffner
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
Sauce Labs
How To Use Selenium Successfully
How To Use Selenium Successfully
Dave Haeffner
Breaking the limits_of_page_objects
Breaking the limits_of_page_objects
Robert Bossek
Getting Started with Selenium
Getting Started with Selenium
Dave Haeffner
Selenium Automation
Selenium Automation
Anuradha Malalasena
Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully
Applitools
Getting started with Selenium 2
Getting started with Selenium 2
Sebastiano Armeli
Gilt Groupe's Selenium 2 Conversion Challenges
Gilt Groupe's Selenium 2 Conversion Challenges
Sauce Labs
Automation Testing using Selenium Webdriver
Automation Testing using Selenium Webdriver
Pankaj Biswas
Selenium
Selenium
mdfkhan625
Selenium
Selenium
David Rajah Selvaraj
How to use selenium successfully
How to use selenium successfully
TEST Huddle
Automation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra Solutions
Quontra Solutions
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
Dave Haeffner
Automation Testing
Automation Testing
AbdulImrankhan7
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Simplilearn
Browser-Based testing using Selenium
Browser-Based testing using Selenium
ret0
Real World Selenium
Real World Selenium
ColdFusionConference
Selenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep Sharda
Er. Sndp Srda
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Dave Haeffner
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
Sauce Labs
How To Use Selenium Successfully
How To Use Selenium Successfully
Dave Haeffner
Breaking the limits_of_page_objects
Breaking the limits_of_page_objects
Robert Bossek
Getting Started with Selenium
Getting Started with Selenium
Dave Haeffner
Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully
Applitools
Getting started with Selenium 2
Getting started with Selenium 2
Sebastiano Armeli
Gilt Groupe's Selenium 2 Conversion Challenges
Gilt Groupe's Selenium 2 Conversion Challenges
Sauce Labs
Automation Testing using Selenium Webdriver
Automation Testing using Selenium Webdriver
Pankaj Biswas
How to use selenium successfully
How to use selenium successfully
TEST Huddle
Automation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra Solutions
Quontra Solutions
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
Dave Haeffner
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Simplilearn
Browser-Based testing using Selenium
Browser-Based testing using Selenium
ret0
Selenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep Sharda
Er. Sndp Srda
Ad

Selenium

  • 2. 2 RBS54273 History 2004, ThoughtWorks, Chicago, Jason Huggins, Core code. Shinya Kasatani, ThoughtWorks, Japan, Selenium IDE. Jason Huggins, left ThoughtWorks, 2007. Jennifer Bevan & Jason Huggins, Google, Worked on RC. Simon Stewart, ThoughtWorks, WebDriver.
  • 3. 3 RBS54273 What Framework that runs in your web-browser and in headless mode. Hooks for many other languages. Java, Ruby, Python, C# etc Simulate a user navigating through pages and then assert for specific marks on the pages. Antidote to Mercury poisoning.
  • 4. 4 RBS54273 Types IDE RC Selenium 1 Webdriver Selenium 2 Grid
  • 5. 5 RBS54273 Why Open source. Supports multiple languages. Cross browser support. Cross OS support. Runs in both headless and browser mode. Parallel execution. CI compatible. Unit testing framework support like Junit, TestNG, NUnit, Rspec etc. Mobile testing support using Android, IPhone, IPad & Blackberry drivers etc.
  • 6. 6 RBS54273 Locators ID id=textId Name name=textName CSS css=em XPATH Relative (//div[@id=123]/span) Absolute (/html/body/div[1])
  • 14. 14 RBS54273 Page object model Challenge Unmaintainable project. Duplicated code. Not easy to track changes. Solution Use Page object model. About All page specific elements/ methods has to be extracted to separate classes. Eliminates duplication. Improves readability. Less key strokes.
  • 15. 15 RBS54273 P.O.M Cont-d public 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(); } } Then in any test class we can call above function like : LoginPage loginPage=new LoginPage(); HomePage homePage=loginPage.login(singmaz,pass123#);
  • 18. 18 RBS54273 Steps 1) java -jar selenium-server-standalone-2.14.0.jar -role hub (by default it registers at 4444) 2) Open the browser and run the following URL http://localhost:4444/console 3) Open the command prompt at node1 and go to the directory selenium-grid-1.0.8- binselenium-grid-1.0.8 4) Type : java -jar selenium-server-standalone-2.14.0.jar -role node -Dport=5555 -Dhost=192.168.1.149 -DhubURL=http://192.168.1.25:4444 -Denvironment=*firefox launch-remote-control 5) Similarly for node2.noden 6) Everything is sorted.