SlideShare uma empresa Scribd logo
1 de 16
Baixar para ler offline
MD
Full-day Tutorials
5/5/2014 8:30:00 AM
Hands On with Selenium
and WebDriver
Presented by:
Alan Richardson
Compendium Developments
Brought to you by:
340 Corporate Way, Suite 300, Orange Park, FL 32073
888-268-8770 ∙ 904-278-0524 ∙ sqeinfo@sqe.com ∙ www.sqe.com
Alan Richardson
Compendium Developments
Alan Richardson has more than twenty years of professional IT experience, working as a
programmer and at every level of the testing hierarchy from tester through head of testing. Author of
the books Selenium Simplified and Java For Testers, Alan also has created online training courses
to help people learn technical web testing and Selenium WebDriver with Java. He now works as an
independent consultant, helping companies improve their use of automation, agile, and exploratory
technical testing. Alan posts his writing and training videos
on SeleniumSimplified.com, EvilTester.com, JavaForTesters.com, and CompendiumDev.co.uk.
© Compendium Developments, 2014, CompendiumDev.co.uk
Hands On WebDriver: Training
Exercises For One Day
Alan Richardson
@eviltester
alan@compendiumdev.co.uk
www.SeleniumSimplified.com
www.EvilTester.com
www.CompendiumDev.co.uk
www.JavaForTesters.com
© Compendium Developments, 2014, CompendiumDev.co.uk
Blogs and Websites
●
CompendiumDev.co.uk
●
SeleniumSimplified.com
●
EvilTester.com
●
JavaForTesters.com
●
Twitter: @eviltester
Online Training Courses
●
Technical Web Testing 101
Unow.be/at/udemy101
●
Intro to Selenium
Unow.be/at/udemystart
●
Selenium 2 WebDriver API
Unow.be/at/udemyapi
Videos
youtube.com/user/EviltesterVideos
Books
Selenium Simplified
Unow.be/rc/selsimp
Java For Testers
leanpub.com/javaForTesters
Alan Richardson
uk.linkedin.com/in/eviltester
Independent Test Consultant
& Custom Training
Contact Alan
http://compendiumdev.co.uk/contact
© Compendium Developments, 2014, CompendiumDev.co.uk
Exercises
© Compendium Developments, 2014, CompendiumDev.co.uk
Exercises: My First Test
1) Create the Class and Test for “My First
Extended Test”
– http://seleniumsimplified.com/testpages/basic_web_page.html
●
Get Page, Check Title, Find para1, Check Text
2) Find paragraph 1 using the Class Name "main"
3) Find paragraph 1 and check that getAttribute
can return the class name correctly
4) Find all the paragraphs and check that there
are 2 of them
© Compendium Developments, 2014, CompendiumDev.co.uk
Exercises: My First Test .cont
5) Check that find element when the By would
match multiple elements e.g. By.tagName("p")
returns the first one
6) Check that findElement, when it can't find
anything, throws an exception e.g.
By.id("missing")
– What type of exception is thrown?
– What happens to the test?
7) Check that findElements, when it can't find
anything, returns an empty collection and does
not throw an exception
© Compendium Developments, 2014, CompendiumDev.co.uk
Exercises: Hamcrest
●
Instead of Assert.assertTrue use
– assertThat(<condition>, is(true));
●
Instead of Assert.assertEquals use
– assertThat(<value>, equalTo(<value>));
– assertThat(<value>, is(<value>));
© Compendium Developments, 2014, CompendiumDev.co.uk
Exercises: JUnit
●
Move the driver creation and quit into
@BeforeClass and @AfterClass
●
Move the driver.get into @Before, and
driver.close into @After
●
What happens to the tests now?
●
What happens when a test throws an exception
now?
© Compendium Developments, 2014, CompendiumDev.co.uk
Exercises: Navigation
●
Use the URLs in the table
– navigate() .to(), .forward(), back(), .refresh()
– Assert on titles to check navigation worked
●
http://seleniumsimplified.com/testpages
File Path Title
/ "Selenium Test Pages"
/search.php "Selenium Simplified Search Engine"
/basic_html_form.html "HTML Form Elements"
/basic_web_page.html "Basic Web Page Title"
/refresh.php "Refreshed Page on ([0-9]{10})"
© Compendium Developments, 2014, CompendiumDev.co.uk
Exercises: Interrogation
●
Using /find_by_playground.php
●
Assert that the URL is correct
●
findElement and then assert
– e.g. getText(), getAttribute(“id”)
●
Create a test for each By
– By.id
– By.linkText
– By.name
– By.partialLinkText
– By.className
●
Experiment with getSize, getLocation etc.
“NoSuchElementException”
means that the locator
didn't match anything
in the DOM.
Inspect the DOM or
look at the page source
to identify locator
approaches
If multiple elements
match then
findElement
will return the first.
e.g., try
Debug mode,
or
System.out.println
© Compendium Developments, 2014, CompendiumDev.co.uk
Exercises: Manipulation
1) Submit form and assert page title changes
2) Clear, then type comments, submit form and check output
3) Submit form with radio 2 selected
4) Submit form with only checkbox 1 selected
Using http://seleniumsimplified.com/testpages/basic_html_form.html
You might need to run these tests in 'debug' mode, because we
have not covered synchronisation yet.
Or after creating the driver, add:
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
© Compendium Developments, 2014, CompendiumDev.co.uk
Exercises: Manipulation Bonus
●
testpages/basic_ajax.html
●
Manually, select “server”, select “java”, submit,
check submitted details
●
automate with .click and previous interrogation
learning
●
Run in Debug Mode
© Compendium Developments, 2014, CompendiumDev.co.uk
Exercises: Locators - CSS & XPath
© Compendium Developments, 2014, CompendiumDev.co.uk
Manual Locator Exercises
Use FirePath to experiment with CSS & Xpath
Selectors on /testpages/find_by_playground.php
●
Select All links
●
Select all the anchors
●
Select the 13th
Link
●
Experiment
© Compendium Developments, 2014, CompendiumDev.co.uk
CSS Basic Exercises
●
Use By.cssSelector as replacement for
– By.id, By.name, By.className, By.tagName
– Create test first using By.id (etc.)
– Check test works
– Replace By.id (etc.) with By.cssSelector
●
Optionally – repeat above for xpath
Replace Assert
By.id(“p31”) getAttribute(“name”) == “pName31”
By.name(“ulName1”) getAttribute(“id”) == “ul1”
By.className(“specialDiv”) getAttribute(“id”) == “div1”
By.tagName(“li”) getAttribute(“name”) == “liName1”
© Compendium Developments, 2014, CompendiumDev.co.uk
Exercises: Synchronisation
●
Run the test FixFailingTest.java in debug mode and
check it works when you step through slowly
●
Run it as a test and it fails
●
Fix by increasing implicit wait time
●
Set implicit wait time to 0 and fix by Adding
Synchronisation code using the ExpectedConditions
class so that the test runs
●
There is more than one way to do this. When you have
one approach try and find at least one more (the
answers show 4 ways to do this)
© Compendium Developments, 2014, CompendiumDev.co.uk
Exercises: Synchronisation (Bonus)
●
Create a custom expected condition to fix the
test
– Inline with anonymous function
– Using a private method that returns an
ExpectedCondition
– Using a custom ExpectedCondition class
© Compendium Developments, 2014, CompendiumDev.co.uk
Exercises: Page Objects
●
Using a Fixed Ajax Test as a basis, create a
Page Object for the basic_ajax page and use
that in the tests.
●
Create a version of the page object that uses
the Page Factory
●
Make the results page a
SlowLoadableComponent based Page Object
© Compendium Developments, 2014, CompendiumDev.co.uk
Optional Exercises
●
Refactor existing tests to use Page Objects
●
Refactor tests so urls are in a single object e.g.
Site.BASE_URL
●
Use the “Select” support class for the Ajax tests
●
Add Synchronisation to the Manipulation Test
●
Run tests using a different browser
●
Use the other pages in /testpages and create Page
Objects and tests to handle the functionality on the test
pages
– e.g. cookies, alerts, submit forms
●
Create a Driver class which lets you configure browsers in
a single location
Answers are not provided for these – work through these at your own pace
© Compendium Developments, 2014, CompendiumDev.co.uk
Answers
When no answer section exists then see the
sample code
© Compendium Developments, 2014, CompendiumDev.co.uk
Answers: My First Test
1)See code on original slide
2)WebElement para1 =
driver.findElement(By.className("main"));
3)Assert.assertTrue(
para1.getAttribute("class").equals("main"));
4)Assert.assertEquals(
driver.findElements(By.tagName("p")).size(), 2);
5)Assert.assertTrue(driver.findElement(By.tagName("p")).
getAttribute("id").equals("para1"));
6)WebElement missing =
driver.findElement(By.id("missing"));
– NoSuchElementException
– leaves browser open
7)Assert.assertEquals(driver.findElements(
By.id("missing")).size(),0);
© Compendium Developments, 2014, CompendiumDev.co.uk
Answers: Hamcrest
●
Import from hamcrest matchers
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
AssertThat(
driver.getTitle().equals("Basic Web Page Title"), is(true));
assertThat(driver.getTitle(), equalTo("Basic Web Page Title"));
assertThat(driver.getTitle(), is("Basic Web Page Title"));
© Compendium Developments, 2014, CompendiumDev.co.uk
Answers: JUnit
●
Static required for class
level methods
●
Tests now focus on
assertions and actions,
not setup
●
Failing tests don't leave
browsers open
●
Easier now to create new
tests instead of expanding
existing
static WebDriver driver;
final String PAGE_URL =
"http://seleniumsimplified.com/testpages/basic_web_page.html";
@BeforeClass
public static void createDriver(){
driver = new FirefoxDriver();
}
@Before
public void gotoPage(){
driver.get(PAGE_URL);
}
@After
public void closePage(){
driver.close();
}
@AfterClass
public static void closeBrowser(){
driver.quit();
}
© Compendium Developments, 2014, CompendiumDev.co.uk
Answers: Manual CSS Selectors
●
a[href]
●
a[name^="p"]
●
#div18 ul li:nth-child(13) a
© Compendium Developments, 2014, CompendiumDev.co.uk
Answers: Manual XPath Selectors
●
//a[@href]
●
//a[not(@href)]
– Or
– //a[starts-with(@name,"p")]
●
(//a[@href])[13]
© Compendium Developments, 2014, CompendiumDev.co.uk
Answers: CSS Basic Exercises
●
I have two sets of sample answers because
there are so many ways of fulfilling the result
– FindByCSSSelectorBasicExercisesTest
– FindByCSSSelectorBasicExercisesFullAnswersTest
© Compendium Developments, 2014, CompendiumDev.co.uk
Answers: Synchronisation
●
Full answers in the code. Hint: prior to 2nd
select
●
And you might need to wait for the results to be ready
new WebDriverWait(driver,10).until(
ExpectedConditions.invisibilityOfElementLocated(
By.id("ajaxBusy")));
new WebDriverWait(driver,10).until(
ExpectedConditions.presenceOfElementLocated(
By.cssSelector("option[value='23']")));
new WebDriverWait(driver,10).until(
ExpectedConditions.visibilityOfElementLocated(
By.cssSelector("option[value='23']")));
new WebDriverWait(driver,10).until(
ExpectedConditions.elementToBeClickable(
By.cssSelector("option[value='23']")));
© Compendium Developments, 2014, CompendiumDev.co.uk
Blogs and Websites
●
CompendiumDev.co.uk
●
SeleniumSimplified.com
●
EvilTester.com
●
JavaForTesters.com
●
Twitter: @eviltester
Online Training Courses
●
Technical Web Testing 101
Unow.be/at/udemy101
●
Intro to Selenium
Unow.be/at/udemystart
●
Selenium 2 WebDriver API
Unow.be/at/udemyapi
Videos
youtube.com/user/EviltesterVideos
Books
Selenium Simplified
Unow.be/rc/selsimp
Java For Testers
leanpub.com/javaForTesters
Alan Richardson
uk.linkedin.com/in/eviltester
Independent Test Consultant
& Custom Training
Contact Alan
http://compendiumdev.co.uk/contact

Mais conteúdo relacionado

Mais procurados

ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewShahed Chowdhuri
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - IntroductionAmr E. Mohamed
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework tola99
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework Serhat Can
 
The Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.jsThe Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.jsHolly Schinsky
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - CoreDzmitry Naskou
 
Angular Dependency Injection
Angular Dependency InjectionAngular Dependency Injection
Angular Dependency InjectionNir Kaufman
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot IntroductionJeevesh Pandey
 
Hybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionHybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionGanuka Yashantha
 
Mobile application development React Native - Tidepool Labs
Mobile application development React Native - Tidepool LabsMobile application development React Native - Tidepool Labs
Mobile application development React Native - Tidepool LabsHarutyun Abgaryan
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectJadson Santos
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action Alex Movila
 

Mais procurados (20)

ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
 
Introduction to Selenium Web Driver
Introduction to Selenium Web DriverIntroduction to Selenium Web Driver
Introduction to Selenium Web Driver
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Introduction to java technology
Introduction to java technologyIntroduction to java technology
Introduction to java technology
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
The Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.jsThe Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.js
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - Core
 
Angular Dependency Injection
Angular Dependency InjectionAngular Dependency Injection
Angular Dependency Injection
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
 
Hybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionHybrid Automation Framework Development introduction
Hybrid Automation Framework Development introduction
 
Xke spring boot
Xke spring bootXke spring boot
Xke spring boot
 
Mobile application development React Native - Tidepool Labs
Mobile application development React Native - Tidepool LabsMobile application development React Native - Tidepool Labs
Mobile application development React Native - Tidepool Labs
 
Angular
AngularAngular
Angular
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
 
Flutter
FlutterFlutter
Flutter
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action
 

Destaque

Twelve Tips for Becoming a More Professional Tester
Twelve Tips for Becoming a More Professional TesterTwelve Tips for Becoming a More Professional Tester
Twelve Tips for Becoming a More Professional TesterTechWell
 
Implementing Testing for Behavior-Driven Development Using Cucumber
Implementing Testing for Behavior-Driven Development Using CucumberImplementing Testing for Behavior-Driven Development Using Cucumber
Implementing Testing for Behavior-Driven Development Using CucumberTechWell
 
We’re Moving to Agile: What Are Our Testers Going to Do?
We’re Moving to Agile: What Are Our Testers Going to Do?We’re Moving to Agile: What Are Our Testers Going to Do?
We’re Moving to Agile: What Are Our Testers Going to Do?TechWell
 
Succeeding as an Ethnic or Minority Tester
Succeeding as an Ethnic or Minority TesterSucceeding as an Ethnic or Minority Tester
Succeeding as an Ethnic or Minority TesterTechWell
 
Patterns of Automation: Simplify Your Test Code
Patterns of Automation: Simplify Your Test CodePatterns of Automation: Simplify Your Test Code
Patterns of Automation: Simplify Your Test CodeTechWell
 
Test Management for Busy People
Test Management for Busy PeopleTest Management for Busy People
Test Management for Busy PeopleTechWell
 
Automated Analytics Testing with Open Source Tools
Automated Analytics Testing with Open Source ToolsAutomated Analytics Testing with Open Source Tools
Automated Analytics Testing with Open Source ToolsTechWell
 
Apply Emotional Intelligence to Your Testing
Apply Emotional Intelligence to Your TestingApply Emotional Intelligence to Your Testing
Apply Emotional Intelligence to Your TestingTechWell
 
Exploring Usability Testing
Exploring Usability TestingExploring Usability Testing
Exploring Usability TestingTechWell
 
Test Process Improvement in Agile
Test Process Improvement in AgileTest Process Improvement in Agile
Test Process Improvement in AgileTechWell
 
The Dirty Little Secret of Business
The Dirty Little Secret of BusinessThe Dirty Little Secret of Business
The Dirty Little Secret of BusinessTechWell
 
Team Leadership: Telling Your Testing Stories
Team Leadership: Telling Your Testing StoriesTeam Leadership: Telling Your Testing Stories
Team Leadership: Telling Your Testing StoriesTechWell
 
Continuous Performance Testing: The New Standard
Continuous Performance Testing: The New StandardContinuous Performance Testing: The New Standard
Continuous Performance Testing: The New StandardTechWell
 
Making Numbers Count: Metrics That Matter
Making Numbers Count: Metrics That MatterMaking Numbers Count: Metrics That Matter
Making Numbers Count: Metrics That MatterTechWell
 

Destaque (14)

Twelve Tips for Becoming a More Professional Tester
Twelve Tips for Becoming a More Professional TesterTwelve Tips for Becoming a More Professional Tester
Twelve Tips for Becoming a More Professional Tester
 
Implementing Testing for Behavior-Driven Development Using Cucumber
Implementing Testing for Behavior-Driven Development Using CucumberImplementing Testing for Behavior-Driven Development Using Cucumber
Implementing Testing for Behavior-Driven Development Using Cucumber
 
We’re Moving to Agile: What Are Our Testers Going to Do?
We’re Moving to Agile: What Are Our Testers Going to Do?We’re Moving to Agile: What Are Our Testers Going to Do?
We’re Moving to Agile: What Are Our Testers Going to Do?
 
Succeeding as an Ethnic or Minority Tester
Succeeding as an Ethnic or Minority TesterSucceeding as an Ethnic or Minority Tester
Succeeding as an Ethnic or Minority Tester
 
Patterns of Automation: Simplify Your Test Code
Patterns of Automation: Simplify Your Test CodePatterns of Automation: Simplify Your Test Code
Patterns of Automation: Simplify Your Test Code
 
Test Management for Busy People
Test Management for Busy PeopleTest Management for Busy People
Test Management for Busy People
 
Automated Analytics Testing with Open Source Tools
Automated Analytics Testing with Open Source ToolsAutomated Analytics Testing with Open Source Tools
Automated Analytics Testing with Open Source Tools
 
Apply Emotional Intelligence to Your Testing
Apply Emotional Intelligence to Your TestingApply Emotional Intelligence to Your Testing
Apply Emotional Intelligence to Your Testing
 
Exploring Usability Testing
Exploring Usability TestingExploring Usability Testing
Exploring Usability Testing
 
Test Process Improvement in Agile
Test Process Improvement in AgileTest Process Improvement in Agile
Test Process Improvement in Agile
 
The Dirty Little Secret of Business
The Dirty Little Secret of BusinessThe Dirty Little Secret of Business
The Dirty Little Secret of Business
 
Team Leadership: Telling Your Testing Stories
Team Leadership: Telling Your Testing StoriesTeam Leadership: Telling Your Testing Stories
Team Leadership: Telling Your Testing Stories
 
Continuous Performance Testing: The New Standard
Continuous Performance Testing: The New StandardContinuous Performance Testing: The New Standard
Continuous Performance Testing: The New Standard
 
Making Numbers Count: Metrics That Matter
Making Numbers Count: Metrics That MatterMaking Numbers Count: Metrics That Matter
Making Numbers Count: Metrics That Matter
 

Semelhante a Hands On WebDriver Training

Introduction to Selenium and WebDriver
Introduction to Selenium and WebDriverIntroduction to Selenium and WebDriver
Introduction to Selenium and WebDriverTechWell
 
WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!Taylor Lovett
 
Selenium Testing with TestingBot.com
Selenium Testing with TestingBot.comSelenium Testing with TestingBot.com
Selenium Testing with TestingBot.comtestingbot
 
Agile Java Testing With Open Source Frameworks
Agile Java Testing With Open Source FrameworksAgile Java Testing With Open Source Frameworks
Agile Java Testing With Open Source FrameworksViraf Karai
 
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...murtazahaveliwala
 
Angular Intermediate
Angular IntermediateAngular Intermediate
Angular IntermediateLinkMe Srl
 
High ROI Testing in Angular.pptx
High ROI Testing in Angular.pptxHigh ROI Testing in Angular.pptx
High ROI Testing in Angular.pptxChristian Lüdemann
 
Integrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectIntegrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectKnoldus Inc.
 
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Matt Raible
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with AppiumLuke Maung
 
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...Edureka!
 
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test AutomationSTARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test AutomationClever Moe
 
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...Alan Richardson
 
The way to set automation testing
The way to set automation testingThe way to set automation testing
The way to set automation testingDuy Tan Geek
 
Good practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsGood practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsAbhijeet Vaikar
 
Unit Testing - Calgary .NET User Group - Nov 26 2014 - Depth Consulting
Unit Testing -  Calgary .NET User Group - Nov 26 2014 - Depth ConsultingUnit Testing -  Calgary .NET User Group - Nov 26 2014 - Depth Consulting
Unit Testing - Calgary .NET User Group - Nov 26 2014 - Depth ConsultingDave White
 
Selenium C# - The Essential Test Automation Guide
Selenium C# - The Essential Test Automation GuideSelenium C# - The Essential Test Automation Guide
Selenium C# - The Essential Test Automation GuideRapidValue
 
Shahnawaz Md Test Engineer
Shahnawaz Md Test EngineerShahnawaz Md Test Engineer
Shahnawaz Md Test EngineerShahnawaz Md
 
From 0 to 100: How we jump-started our frontend testing
From 0 to 100: How we jump-started our frontend testingFrom 0 to 100: How we jump-started our frontend testing
From 0 to 100: How we jump-started our frontend testingHenning Muszynski
 
Automated Testing using JavaScript
Automated Testing using JavaScriptAutomated Testing using JavaScript
Automated Testing using JavaScriptSimon Guest
 

Semelhante a Hands On WebDriver Training (20)

Introduction to Selenium and WebDriver
Introduction to Selenium and WebDriverIntroduction to Selenium and WebDriver
Introduction to Selenium and WebDriver
 
WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!
 
Selenium Testing with TestingBot.com
Selenium Testing with TestingBot.comSelenium Testing with TestingBot.com
Selenium Testing with TestingBot.com
 
Agile Java Testing With Open Source Frameworks
Agile Java Testing With Open Source FrameworksAgile Java Testing With Open Source Frameworks
Agile Java Testing With Open Source Frameworks
 
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
 
Angular Intermediate
Angular IntermediateAngular Intermediate
Angular Intermediate
 
High ROI Testing in Angular.pptx
High ROI Testing in Angular.pptxHigh ROI Testing in Angular.pptx
High ROI Testing in Angular.pptx
 
Integrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectIntegrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala Project
 
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
 
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
 
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test AutomationSTARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
 
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
 
The way to set automation testing
The way to set automation testingThe way to set automation testing
The way to set automation testing
 
Good practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsGood practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium tests
 
Unit Testing - Calgary .NET User Group - Nov 26 2014 - Depth Consulting
Unit Testing -  Calgary .NET User Group - Nov 26 2014 - Depth ConsultingUnit Testing -  Calgary .NET User Group - Nov 26 2014 - Depth Consulting
Unit Testing - Calgary .NET User Group - Nov 26 2014 - Depth Consulting
 
Selenium C# - The Essential Test Automation Guide
Selenium C# - The Essential Test Automation GuideSelenium C# - The Essential Test Automation Guide
Selenium C# - The Essential Test Automation Guide
 
Shahnawaz Md Test Engineer
Shahnawaz Md Test EngineerShahnawaz Md Test Engineer
Shahnawaz Md Test Engineer
 
From 0 to 100: How we jump-started our frontend testing
From 0 to 100: How we jump-started our frontend testingFrom 0 to 100: How we jump-started our frontend testing
From 0 to 100: How we jump-started our frontend testing
 
Automated Testing using JavaScript
Automated Testing using JavaScriptAutomated Testing using JavaScript
Automated Testing using JavaScript
 

Mais de TechWell

Failing and Recovering
Failing and RecoveringFailing and Recovering
Failing and RecoveringTechWell
 
Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization TechWell
 
Test Design for Fully Automated Build Architecture
Test Design for Fully Automated Build ArchitectureTest Design for Fully Automated Build Architecture
Test Design for Fully Automated Build ArchitectureTechWell
 
System-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good StartSystem-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good StartTechWell
 
Build Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test StrategyBuild Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test StrategyTechWell
 
Testing Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for SuccessTesting Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for SuccessTechWell
 
Implement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowImplement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowTechWell
 
Develop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your SanityDevelop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your SanityTechWell
 
Eliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyEliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyTechWell
 
Transform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOpsTransform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOpsTechWell
 
The Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—LeadershipThe Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—LeadershipTechWell
 
Resolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile TeamsResolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile TeamsTechWell
 
Pin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile GamePin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile GameTechWell
 
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile TeamsAgile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile TeamsTechWell
 
A Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps ImplementationA Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps ImplementationTechWell
 
Databases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery ProcessDatabases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery ProcessTechWell
 
Mobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to AutomateMobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to AutomateTechWell
 
Cultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for SuccessCultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for SuccessTechWell
 
Turn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile TransformationTurn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile TransformationTechWell
 

Mais de TechWell (20)

Failing and Recovering
Failing and RecoveringFailing and Recovering
Failing and Recovering
 
Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization
 
Test Design for Fully Automated Build Architecture
Test Design for Fully Automated Build ArchitectureTest Design for Fully Automated Build Architecture
Test Design for Fully Automated Build Architecture
 
System-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good StartSystem-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good Start
 
Build Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test StrategyBuild Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test Strategy
 
Testing Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for SuccessTesting Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for Success
 
Implement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowImplement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlow
 
Develop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your SanityDevelop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your Sanity
 
Ma 15
Ma 15Ma 15
Ma 15
 
Eliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyEliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps Strategy
 
Transform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOpsTransform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOps
 
The Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—LeadershipThe Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—Leadership
 
Resolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile TeamsResolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile Teams
 
Pin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile GamePin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile Game
 
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile TeamsAgile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
 
A Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps ImplementationA Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps Implementation
 
Databases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery ProcessDatabases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery Process
 
Mobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to AutomateMobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to Automate
 
Cultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for SuccessCultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for Success
 
Turn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile TransformationTurn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile Transformation
 

Último

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 

Último (20)

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 

Hands On WebDriver Training

  • 1. MD Full-day Tutorials 5/5/2014 8:30:00 AM Hands On with Selenium and WebDriver Presented by: Alan Richardson Compendium Developments Brought to you by: 340 Corporate Way, Suite 300, Orange Park, FL 32073 888-268-8770 ∙ 904-278-0524 ∙ sqeinfo@sqe.com ∙ www.sqe.com
  • 2. Alan Richardson Compendium Developments Alan Richardson has more than twenty years of professional IT experience, working as a programmer and at every level of the testing hierarchy from tester through head of testing. Author of the books Selenium Simplified and Java For Testers, Alan also has created online training courses to help people learn technical web testing and Selenium WebDriver with Java. He now works as an independent consultant, helping companies improve their use of automation, agile, and exploratory technical testing. Alan posts his writing and training videos on SeleniumSimplified.com, EvilTester.com, JavaForTesters.com, and CompendiumDev.co.uk.
  • 3. © Compendium Developments, 2014, CompendiumDev.co.uk Hands On WebDriver: Training Exercises For One Day Alan Richardson @eviltester alan@compendiumdev.co.uk www.SeleniumSimplified.com www.EvilTester.com www.CompendiumDev.co.uk www.JavaForTesters.com © Compendium Developments, 2014, CompendiumDev.co.uk Blogs and Websites ● CompendiumDev.co.uk ● SeleniumSimplified.com ● EvilTester.com ● JavaForTesters.com ● Twitter: @eviltester Online Training Courses ● Technical Web Testing 101 Unow.be/at/udemy101 ● Intro to Selenium Unow.be/at/udemystart ● Selenium 2 WebDriver API Unow.be/at/udemyapi Videos youtube.com/user/EviltesterVideos Books Selenium Simplified Unow.be/rc/selsimp Java For Testers leanpub.com/javaForTesters Alan Richardson uk.linkedin.com/in/eviltester Independent Test Consultant & Custom Training Contact Alan http://compendiumdev.co.uk/contact
  • 4. © Compendium Developments, 2014, CompendiumDev.co.uk Exercises © Compendium Developments, 2014, CompendiumDev.co.uk Exercises: My First Test 1) Create the Class and Test for “My First Extended Test” – http://seleniumsimplified.com/testpages/basic_web_page.html ● Get Page, Check Title, Find para1, Check Text 2) Find paragraph 1 using the Class Name "main" 3) Find paragraph 1 and check that getAttribute can return the class name correctly 4) Find all the paragraphs and check that there are 2 of them
  • 5. © Compendium Developments, 2014, CompendiumDev.co.uk Exercises: My First Test .cont 5) Check that find element when the By would match multiple elements e.g. By.tagName("p") returns the first one 6) Check that findElement, when it can't find anything, throws an exception e.g. By.id("missing") – What type of exception is thrown? – What happens to the test? 7) Check that findElements, when it can't find anything, returns an empty collection and does not throw an exception © Compendium Developments, 2014, CompendiumDev.co.uk Exercises: Hamcrest ● Instead of Assert.assertTrue use – assertThat(<condition>, is(true)); ● Instead of Assert.assertEquals use – assertThat(<value>, equalTo(<value>)); – assertThat(<value>, is(<value>));
  • 6. © Compendium Developments, 2014, CompendiumDev.co.uk Exercises: JUnit ● Move the driver creation and quit into @BeforeClass and @AfterClass ● Move the driver.get into @Before, and driver.close into @After ● What happens to the tests now? ● What happens when a test throws an exception now? © Compendium Developments, 2014, CompendiumDev.co.uk Exercises: Navigation ● Use the URLs in the table – navigate() .to(), .forward(), back(), .refresh() – Assert on titles to check navigation worked ● http://seleniumsimplified.com/testpages File Path Title / "Selenium Test Pages" /search.php "Selenium Simplified Search Engine" /basic_html_form.html "HTML Form Elements" /basic_web_page.html "Basic Web Page Title" /refresh.php "Refreshed Page on ([0-9]{10})"
  • 7. © Compendium Developments, 2014, CompendiumDev.co.uk Exercises: Interrogation ● Using /find_by_playground.php ● Assert that the URL is correct ● findElement and then assert – e.g. getText(), getAttribute(“id”) ● Create a test for each By – By.id – By.linkText – By.name – By.partialLinkText – By.className ● Experiment with getSize, getLocation etc. “NoSuchElementException” means that the locator didn't match anything in the DOM. Inspect the DOM or look at the page source to identify locator approaches If multiple elements match then findElement will return the first. e.g., try Debug mode, or System.out.println © Compendium Developments, 2014, CompendiumDev.co.uk Exercises: Manipulation 1) Submit form and assert page title changes 2) Clear, then type comments, submit form and check output 3) Submit form with radio 2 selected 4) Submit form with only checkbox 1 selected Using http://seleniumsimplified.com/testpages/basic_html_form.html You might need to run these tests in 'debug' mode, because we have not covered synchronisation yet. Or after creating the driver, add: driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
  • 8. © Compendium Developments, 2014, CompendiumDev.co.uk Exercises: Manipulation Bonus ● testpages/basic_ajax.html ● Manually, select “server”, select “java”, submit, check submitted details ● automate with .click and previous interrogation learning ● Run in Debug Mode © Compendium Developments, 2014, CompendiumDev.co.uk Exercises: Locators - CSS & XPath
  • 9. © Compendium Developments, 2014, CompendiumDev.co.uk Manual Locator Exercises Use FirePath to experiment with CSS & Xpath Selectors on /testpages/find_by_playground.php ● Select All links ● Select all the anchors ● Select the 13th Link ● Experiment © Compendium Developments, 2014, CompendiumDev.co.uk CSS Basic Exercises ● Use By.cssSelector as replacement for – By.id, By.name, By.className, By.tagName – Create test first using By.id (etc.) – Check test works – Replace By.id (etc.) with By.cssSelector ● Optionally – repeat above for xpath Replace Assert By.id(“p31”) getAttribute(“name”) == “pName31” By.name(“ulName1”) getAttribute(“id”) == “ul1” By.className(“specialDiv”) getAttribute(“id”) == “div1” By.tagName(“li”) getAttribute(“name”) == “liName1”
  • 10. © Compendium Developments, 2014, CompendiumDev.co.uk Exercises: Synchronisation ● Run the test FixFailingTest.java in debug mode and check it works when you step through slowly ● Run it as a test and it fails ● Fix by increasing implicit wait time ● Set implicit wait time to 0 and fix by Adding Synchronisation code using the ExpectedConditions class so that the test runs ● There is more than one way to do this. When you have one approach try and find at least one more (the answers show 4 ways to do this) © Compendium Developments, 2014, CompendiumDev.co.uk Exercises: Synchronisation (Bonus) ● Create a custom expected condition to fix the test – Inline with anonymous function – Using a private method that returns an ExpectedCondition – Using a custom ExpectedCondition class
  • 11. © Compendium Developments, 2014, CompendiumDev.co.uk Exercises: Page Objects ● Using a Fixed Ajax Test as a basis, create a Page Object for the basic_ajax page and use that in the tests. ● Create a version of the page object that uses the Page Factory ● Make the results page a SlowLoadableComponent based Page Object © Compendium Developments, 2014, CompendiumDev.co.uk Optional Exercises ● Refactor existing tests to use Page Objects ● Refactor tests so urls are in a single object e.g. Site.BASE_URL ● Use the “Select” support class for the Ajax tests ● Add Synchronisation to the Manipulation Test ● Run tests using a different browser ● Use the other pages in /testpages and create Page Objects and tests to handle the functionality on the test pages – e.g. cookies, alerts, submit forms ● Create a Driver class which lets you configure browsers in a single location Answers are not provided for these – work through these at your own pace
  • 12. © Compendium Developments, 2014, CompendiumDev.co.uk Answers When no answer section exists then see the sample code © Compendium Developments, 2014, CompendiumDev.co.uk Answers: My First Test 1)See code on original slide 2)WebElement para1 = driver.findElement(By.className("main")); 3)Assert.assertTrue( para1.getAttribute("class").equals("main")); 4)Assert.assertEquals( driver.findElements(By.tagName("p")).size(), 2); 5)Assert.assertTrue(driver.findElement(By.tagName("p")). getAttribute("id").equals("para1")); 6)WebElement missing = driver.findElement(By.id("missing")); – NoSuchElementException – leaves browser open 7)Assert.assertEquals(driver.findElements( By.id("missing")).size(),0);
  • 13. © Compendium Developments, 2014, CompendiumDev.co.uk Answers: Hamcrest ● Import from hamcrest matchers import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; AssertThat( driver.getTitle().equals("Basic Web Page Title"), is(true)); assertThat(driver.getTitle(), equalTo("Basic Web Page Title")); assertThat(driver.getTitle(), is("Basic Web Page Title")); © Compendium Developments, 2014, CompendiumDev.co.uk Answers: JUnit ● Static required for class level methods ● Tests now focus on assertions and actions, not setup ● Failing tests don't leave browsers open ● Easier now to create new tests instead of expanding existing static WebDriver driver; final String PAGE_URL = "http://seleniumsimplified.com/testpages/basic_web_page.html"; @BeforeClass public static void createDriver(){ driver = new FirefoxDriver(); } @Before public void gotoPage(){ driver.get(PAGE_URL); } @After public void closePage(){ driver.close(); } @AfterClass public static void closeBrowser(){ driver.quit(); }
  • 14. © Compendium Developments, 2014, CompendiumDev.co.uk Answers: Manual CSS Selectors ● a[href] ● a[name^="p"] ● #div18 ul li:nth-child(13) a © Compendium Developments, 2014, CompendiumDev.co.uk Answers: Manual XPath Selectors ● //a[@href] ● //a[not(@href)] – Or – //a[starts-with(@name,"p")] ● (//a[@href])[13]
  • 15. © Compendium Developments, 2014, CompendiumDev.co.uk Answers: CSS Basic Exercises ● I have two sets of sample answers because there are so many ways of fulfilling the result – FindByCSSSelectorBasicExercisesTest – FindByCSSSelectorBasicExercisesFullAnswersTest © Compendium Developments, 2014, CompendiumDev.co.uk Answers: Synchronisation ● Full answers in the code. Hint: prior to 2nd select ● And you might need to wait for the results to be ready new WebDriverWait(driver,10).until( ExpectedConditions.invisibilityOfElementLocated( By.id("ajaxBusy"))); new WebDriverWait(driver,10).until( ExpectedConditions.presenceOfElementLocated( By.cssSelector("option[value='23']"))); new WebDriverWait(driver,10).until( ExpectedConditions.visibilityOfElementLocated( By.cssSelector("option[value='23']"))); new WebDriverWait(driver,10).until( ExpectedConditions.elementToBeClickable( By.cssSelector("option[value='23']")));
  • 16. © Compendium Developments, 2014, CompendiumDev.co.uk Blogs and Websites ● CompendiumDev.co.uk ● SeleniumSimplified.com ● EvilTester.com ● JavaForTesters.com ● Twitter: @eviltester Online Training Courses ● Technical Web Testing 101 Unow.be/at/udemy101 ● Intro to Selenium Unow.be/at/udemystart ● Selenium 2 WebDriver API Unow.be/at/udemyapi Videos youtube.com/user/EviltesterVideos Books Selenium Simplified Unow.be/rc/selsimp Java For Testers leanpub.com/javaForTesters Alan Richardson uk.linkedin.com/in/eviltester Independent Test Consultant & Custom Training Contact Alan http://compendiumdev.co.uk/contact