SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Web accessibility
Web accessibilityWeb accessibility
Web accessibility
 
Html 5 Features And Benefits
Html 5 Features And Benefits  Html 5 Features And Benefits
Html 5 Features And Benefits
 
Javascript
JavascriptJavascript
Javascript
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework Designs
 
Testing Tools
Testing ToolsTesting Tools
Testing Tools
 
Automation testing
Automation testingAutomation testing
Automation testing
 
Understanding and Supporting Web Accessibility
Understanding and Supporting Web AccessibilityUnderstanding and Supporting Web Accessibility
Understanding and Supporting Web Accessibility
 
Accesibilidad práctica con HTML5, CSS3 y WAI-ARIA
Accesibilidad práctica con HTML5, CSS3 y WAI-ARIAAccesibilidad práctica con HTML5, CSS3 y WAI-ARIA
Accesibilidad práctica con HTML5, CSS3 y WAI-ARIA
 
Ajax and Jquery
Ajax and JqueryAjax and Jquery
Ajax and Jquery
 
Jmeter Performance Testing
Jmeter Performance TestingJmeter Performance Testing
Jmeter Performance Testing
 
WEB TECHNOLOGIES JavaScript
WEB TECHNOLOGIES JavaScriptWEB TECHNOLOGIES JavaScript
WEB TECHNOLOGIES JavaScript
 
Web Accessibility
Web AccessibilityWeb Accessibility
Web Accessibility
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
Angular Advanced Routing
Angular Advanced RoutingAngular Advanced Routing
Angular Advanced Routing
 
Accessibility Testing Approach
Accessibility Testing ApproachAccessibility Testing Approach
Accessibility Testing Approach
 
Accessibility Testing using Axe
Accessibility Testing using AxeAccessibility Testing using Axe
Accessibility Testing using Axe
 
Elements Of Web Design
Elements Of Web DesignElements Of Web Design
Elements Of Web Design
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
 
Web accessibility 101: The why, who, what, and how of "a11y"
Web accessibility 101: The why, who, what, and how of "a11y"Web accessibility 101: The why, who, what, and how of "a11y"
Web accessibility 101: The why, who, what, and how of "a11y"
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Kürzlich hochgeladen (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

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