WebDriver + Thucydides
TDT – October 2, 2013
Vlad Voicu, Gabi Kis
Thucydides intro
Why use Thucydides framework ?
#1 Awesome reports 
Fully integrated with WebDriver
Multiple browsers supported
Native support for DDT
Native support for BDD
Continuous Integration support
Integrated with JIRA
Reports
JUnit
Automate testing process
From Automation testing to Automated testing
Project Structure
Main tools
WebDriver
What?
WebDriver is a browser automation API
Used for?
UI Functional testing
Thucydides
What?
Testing framework using WebDriver
Used for?
Running tests, advanced reports
+
Project structure
Page 1 Page 2 Page 3
Steps
Tests
Project structure
• Java JDK
o http://www.oracle.com/technetwork/java/javase/downloads/jdk6downloads-
1902814.html
o Download and install JDK
• Maven
o http://maven.apache.org/
o Download maven and unpack it on your drive
• Eclipse
o http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-
developers/junosr2
o m2eclipse plug-in
 Eclipse > Help > Install New Software > Work with: All Available Sites > m2e
• Firefox 11
o http://www.oldapps.com/firefox.php?old_firefox=7395
o Disable updates
Environment Setup
Path
MavenJava
Environment Variables
Check setup
Open Command Prompt and check versions:
from the command line
from the Eclipse IDE
How to create a new project
Create a Thucydides project – 1/7
Create a Thucydides project – 2/7
Need to enter a archetype number
Create a Thucydides project – 3/7
How to select the right archetype
Create a Thucydides project – 4/7
Thucydides version number
Create a Thucydides project – 5/7
Group naming
Project naming
Create a Thucydides project – 6/7
Version and package
Create a Thucydides project – 7/7
New Thucydides project - Eclipse
1
2
3
4
Quick glance on Generated Project
Page Objects
Features
Steps
Tests
Our Project structure
Scope
Requirement
As a user I want to enter a search term and
navigate to a result.
Test case:
Go to Google search
Type a search term
Grab a search result from the list
Navigate to it
Validate the navigation
Creating a page
public class GoogleSearchPage{
}
Creating a page
public class GoogleSearchPage extends PageObject {
}
Creating a page
public class GoogleSearchPage extends PageObject {
//add constructor due to PageObject
public GoogleSearchPage (WebDriver driver){
super(driver);
}
}
Creating a page
public class GoogleSearchPage extends PageObject {
…
//add your WebElement to the Page
private WebElement searchInput;
}
Creating a page
public class GoogleSearchPage extends PageObject {
…
@FindBy(|)
private WebElement searchInput;
}
Creating a page
public class GoogleSearchPage extends PageObject {
…
@FindBy(id=“?”)
private WebElement searchInput;
}
Grab elements from HTML
Grab elements from HTML
Find element id:
Creating a page
public class GoogleSearchPage extends PageObject {
…
@FindBy(id=“gbqfq”)
private WebElement searchInput;
}
Creating a page
public class GoogleSearchPage extends PageObject {
…
@FindBy(id=“gbqfq”)
private WebElement searchInput;
@FindBy(id=“gbqfbw”)
private WebElement searchButton;
}
Creating a page
public class GoogleSearchPage extends PageObject {
…
@FindBy(id=“gbqfq”)
private WebElement searchInput;
public void inputTerm(String searchTerm){
element(searchInput).waitUntilVisible();
}
}
Creating a page
public class GoogleSearchPage extends PageObject {
…
@FindBy(id=“gbqfq”)
private WebElement searchInput;
public void inputTerm(String searchTerm){
element(searchInput).waitUntilVisible();
searchInput.sendKeys(searchTerm);
}
}
Creating a page
public class GoogleSearchPage extends PageObject {
…
@FindBy(id=“gbqfbw”)
private WebElement searchButton;
public void clickOnSearch(String searchTerm){
element(searchButton).waitUntilVisible();
searchButton.click();
}
}
Creating Second Page
Creating Second Page
Creating Second Page
Creating Second Page
Creating Second Page
public class GoogleResultsPage extends PageObject {
…
@FindBy(id=“search”)
private WebElement searchResults;
}
Creating Second Page
public class GoogleResultsPage extends PageObject {
public void findResult(String resultTerm){
element(searchResults).waitUntilVisible();
waitFor(ExpectedConditions.presenceOfAllElementsLocatedBy
(By.cssSelector(“div#search li.g”)));
List<WebElement> resultList =
searchResults.findElements(By.cssSelector(“li.g”));
for(WebElement elementNow:resultList){
if(elementNow.getText().contains(resultsTerm)){
elementNow.findElement(By.cssSelector(“a.l”)).click();
break;
}
}}
Adding Steps
Steps are recorded in reports
Method parameters are captured in the report
Step method names are split by camelCase
Adding Steps
public class GoogleSteps extends ScenarioSteps{
public GoogleSteps(Pages pages){
super(pages);
}
}
Adding Steps
public class GoogleSteps extends ScenarioSteps{
…
public GoogleSearchPage googleSearchPage(){
return getPages.currentPageAt(GoogleSearchPage.class);
}
public GoogleResultsPage googleResultsPage(){
return getPages.currentPageAt(GoogleResultsPage.class);
}
}
Adding Steps
public class GoogleSteps extends ScenarioSteps{
…
@Step
public void inputSearchTerm(String search){
googleSearchPage().inputTerm(search);
}
@Step
public void clickOnSearch(){
googleSearchPage(). clickOnSearch();
}
}
Adding Steps
public class GoogleSteps extends ScenarioSteps{
…
@StepGroup
public void performSearch(String search){
inputSearchTerm(search);
clickOnSearch();
}
}
Adding Steps
public class GoogleSteps extends ScenarioSteps{
…
@Step
public void findSearchResult(String search){
googleResultsPage().findResult(search);
}
}
Adding Steps
public class GoogleSteps extends ScenarioSteps{
…
@Step
public void verifyUrl(String url){
Assert.assertTrue(“Url does not match! ”,
getDriver().getCurrentUrl.contains(url));
}
}
Adding Steps
Creating a Test
@RunWith(ThucydidesRunner.class)
public class GoogleSearchTest {
@Managed(uniqueSession = true)
public WebDriver webdriver;
@ManagedPages(defaultUrl = “http://www.google.com”)
public Pages pages;
@Steps
public GoogleSteps googleSteps;
}
Creating a Test
@RunWith(ThucydidesRunner.class)
public class GoogleSearchTest {
…
@ManagedPages(defaultUrl = “http://www.google.com”)
public Pages pages;
…
@Test
public void googleSearchTest(){
googleSteps.performSearch(“evozon”);
googleSteps.findSearchResult(“on Twitter”);
googleSteps.verifyUrl(“twitter.com/evozon”);
}
}
Test
Test case:
Go to Google search
Type a search term
Grab a search result from the list
Navigate to it
Validate the navigation
@RunWith(ThucydidesRunner.class)
public class GoogleSearchTest {
…
@ManagedPages(defaultUrl
= “http://www.google.com”)
public Pages pages;
…
@Test
public void googleSearchTest(){
googleSteps.performSearch(“evozon”);
googleSteps.findSearchResult(“on Twitter”);
googleSteps.verifyUrl(“twitter.com/evozon”);
}
}
Project Example
Project implementation.
Run parameters
mvn integration-test
will run all tests in the project
mvn test –Dtest=[TEST_NAME]
will run specific test
Note: need to configure in pom.xml
mvn test –Dwebdriver.dirver=firefox
will specify the browser to run with
Note: other browsers need additional
configuration
Aggregate reports
mvn thucydides:aggregate
aggregate final report
Report location:
Project Root
– target
– site
– thucydides
– index.html
Data Driven Testing
TestData3
TestData2
TestData1
Test
CSV
File
Outcome
1
Outcome
2
Outcome
3
Data Driven
CSV files
Group tests in features and stories
Group tests in suites
Automate testing process
Jenkins
Automate testing process
Jenkins integration
Questions
Thank you!

More Related Content

PDF
PROMAND 2014 project structure
PPTX
The Best Way to Become an Android Developer Expert with Android Jetpack
PPTX
Android Intermediatte IAK full
PDF
GWTcon 2015 - Beyond GWT 3.0 Panic
PPT
Grails Connecting to MySQL
PDF
google drive and the google drive sdk
PPTX
Grails plugin development
PDF
Grails Simple Login
PROMAND 2014 project structure
The Best Way to Become an Android Developer Expert with Android Jetpack
Android Intermediatte IAK full
GWTcon 2015 - Beyond GWT 3.0 Panic
Grails Connecting to MySQL
google drive and the google drive sdk
Grails plugin development
Grails Simple Login

What's hot (20)

PDF
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
PDF
GWT Reloaded
PPTX
Sword fighting with Dagger GDG-NYC Jan 2016
PDF
Full Stack Reactive with React and Spring WebFlux - SpringOne 2018
PDF
Exploring Google (Cloud) APIs with Python & JavaScript
PDF
React Native Androidはなぜ動くのか
PPTX
The Screenplay Pattern: Better Interactions for Better Automation
PDF
A realtime infrastructure for Android apps: Firebase may be what you need..an...
PPTX
Better web apps with React and Redux
PPTX
WebGL Crash Course
PPTX
Android studio tips and tricks
PDF
Effective Application State Management (@DevCamp2017)
PDF
Hybrid Apps (Native + Web) via QtWebKit
PPTX
Access google command list from the command line
PDF
Google app-engine-with-python
PDF
Making the Most of Your Gradle Builds
PDF
Micronaut: Changing the Micro Future
PPTX
PPTX
Open sourcing the store
PPTX
Gradle build capabilities
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
GWT Reloaded
Sword fighting with Dagger GDG-NYC Jan 2016
Full Stack Reactive with React and Spring WebFlux - SpringOne 2018
Exploring Google (Cloud) APIs with Python & JavaScript
React Native Androidはなぜ動くのか
The Screenplay Pattern: Better Interactions for Better Automation
A realtime infrastructure for Android apps: Firebase may be what you need..an...
Better web apps with React and Redux
WebGL Crash Course
Android studio tips and tricks
Effective Application State Management (@DevCamp2017)
Hybrid Apps (Native + Web) via QtWebKit
Access google command list from the command line
Google app-engine-with-python
Making the Most of Your Gradle Builds
Micronaut: Changing the Micro Future
Open sourcing the store
Gradle build capabilities
Ad

Viewers also liked (20)

PDF
The Future Tester at Suncorp - A Journey of Building Quality In Through Agile
PDF
The Speed to Cool: Agile Testing & Building Quality In
PPS
Examenes de eso
PDF
PIOGA Winter Meeting 2-15
PDF
Two Sides of the Same Coin - the Connection Between Legal and Illegal Immigra...
PPTX
Sosyal Medya ve İçerik Pazarlaması
PPTX
Guía práctica para publicar un artículo
PPTX
Seminario empresas en un dia
PPTX
Tema 7 lengua 6º.Víctor
PPT
Powert ines 6º tema 3 nuevo
PDF
269609464 analisis-de-la-pata-de-mono
PDF
Creación Empresas chile
PPTX
El hombre como ser social
PPTX
Inhaled Corticosteroids Increase the Risk of Pneumonia in Patients with Chron...
PPTX
O novo ASP.NET - Verity IT - Janeiro/2017
PPS
Figaronron - Cirque Mickael
PDF
PPT
4. estadísticas comparativas sobre seguridad
PDF
AURYN - Therapeutisches Reiten 2009
PPTX
Les journées de Chipo - Jour 323
The Future Tester at Suncorp - A Journey of Building Quality In Through Agile
The Speed to Cool: Agile Testing & Building Quality In
Examenes de eso
PIOGA Winter Meeting 2-15
Two Sides of the Same Coin - the Connection Between Legal and Illegal Immigra...
Sosyal Medya ve İçerik Pazarlaması
Guía práctica para publicar un artículo
Seminario empresas en un dia
Tema 7 lengua 6º.Víctor
Powert ines 6º tema 3 nuevo
269609464 analisis-de-la-pata-de-mono
Creación Empresas chile
El hombre como ser social
Inhaled Corticosteroids Increase the Risk of Pneumonia in Patients with Chron...
O novo ASP.NET - Verity IT - Janeiro/2017
Figaronron - Cirque Mickael
4. estadísticas comparativas sobre seguridad
AURYN - Therapeutisches Reiten 2009
Les journées de Chipo - Jour 323
Ad

Similar to Webdriver with Thucydides - TdT@Cluj #18 (20)

PDF
Hybrid App using WordPress
PPTX
Тарас Олексин - Sculpt! Your! Tests!
PPT
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
PDF
Building Grails Plugins - Tips And Tricks
PDF
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
PDF
Gretty: Managing Web Containers with Gradle
PPTX
A test framework out of the box - Geb for Web and mobile
PDF
Google Play Services Rock
PDF
Easy tests with Selenide and Easyb
ODP
WordPress Accessibility: WordCamp Chicago
PDF
Night Watch with QA
PDF
Google Analytics intro - Best practices for WCM
PDF
[@IndeedEng] Building Indeed Resume Search
PDF
BDD, ATDD, Page Objects: The Road to Sustainable Web Testing
PDF
Toolbox for Selenium Tests in Java: WebDriverManager and Selenium-Jupiter
PDF
How to Webpack your Django!
PDF
GDG İstanbul Şubat Etkinliği - Sunum
PDF
DevFest Kuala Lumpur - Implementing Google Analytics - 2011-09-29.ppt
PDF
Design Patterns in Automation Framework.pdf
PDF
Introducing GWT Polymer (vaadin)
Hybrid App using WordPress
Тарас Олексин - Sculpt! Your! Tests!
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
Building Grails Plugins - Tips And Tricks
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Gretty: Managing Web Containers with Gradle
A test framework out of the box - Geb for Web and mobile
Google Play Services Rock
Easy tests with Selenide and Easyb
WordPress Accessibility: WordCamp Chicago
Night Watch with QA
Google Analytics intro - Best practices for WCM
[@IndeedEng] Building Indeed Resume Search
BDD, ATDD, Page Objects: The Road to Sustainable Web Testing
Toolbox for Selenium Tests in Java: WebDriverManager and Selenium-Jupiter
How to Webpack your Django!
GDG İstanbul Şubat Etkinliği - Sunum
DevFest Kuala Lumpur - Implementing Google Analytics - 2011-09-29.ppt
Design Patterns in Automation Framework.pdf
Introducing GWT Polymer (vaadin)

More from Tabăra de Testare (20)

ODP
Zed Attack Proxy (ZAP) Quick Intro - TdT@Cluj #20
ODP
The OWASP Top 10 Most Critical Web App Security Risks - TdT@Cluj #20
PDF
Robotium framework & Jenkins CI tools - TdT@Cluj #19
PPTX
Tap into mobile app testing@TDT Iasi Sept2013
PPSX
Test analysis & design good practices@TDT Iasi 17Oct2013
PDF
Mobile Web UX - TdT@Cluj #17
PPTX
Behavior Driven Development - TdT@Cluj #15
PDF
TdT@Cluj #14 - Mobile Testing Workshop
PPS
Security testing
PDF
Mobile Testing - TdT Cluj #13
PDF
Td t summary
PPTX
How to evaluate a tester
PPT
Testing, job or game
PPTX
Test Automation Techniques for Windows Applications
PPTX
Help them to help you
PDF
Learning the Agile way
PPTX
How to bring creativity in testing
PPTX
Tester with benefits
PPTX
Doing things Differently
PPTX
Testarea: Prieten sau dusman? Adrian speteanu
Zed Attack Proxy (ZAP) Quick Intro - TdT@Cluj #20
The OWASP Top 10 Most Critical Web App Security Risks - TdT@Cluj #20
Robotium framework & Jenkins CI tools - TdT@Cluj #19
Tap into mobile app testing@TDT Iasi Sept2013
Test analysis & design good practices@TDT Iasi 17Oct2013
Mobile Web UX - TdT@Cluj #17
Behavior Driven Development - TdT@Cluj #15
TdT@Cluj #14 - Mobile Testing Workshop
Security testing
Mobile Testing - TdT Cluj #13
Td t summary
How to evaluate a tester
Testing, job or game
Test Automation Techniques for Windows Applications
Help them to help you
Learning the Agile way
How to bring creativity in testing
Tester with benefits
Doing things Differently
Testarea: Prieten sau dusman? Adrian speteanu

Recently uploaded (20)

PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PPTX
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
PPTX
Chapter 5: Probability Theory and Statistics
PPTX
Modernising the Digital Integration Hub
PDF
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
STKI Israel Market Study 2025 version august
PDF
Flame analysis and combustion estimation using large language and vision assi...
PPT
What is a Computer? Input Devices /output devices
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PDF
Five Habits of High-Impact Board Members
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Improvisation in detection of pomegranate leaf disease using transfer learni...
PDF
The influence of sentiment analysis in enhancing early warning system model f...
PPT
Geologic Time for studying geology for geologist
PPTX
Custom Battery Pack Design Considerations for Performance and Safety
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
Architecture types and enterprise applications.pdf
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
A contest of sentiment analysis: k-nearest neighbor versus neural network
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
Chapter 5: Probability Theory and Statistics
Modernising the Digital Integration Hub
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
Benefits of Physical activity for teenagers.pptx
STKI Israel Market Study 2025 version august
Flame analysis and combustion estimation using large language and vision assi...
What is a Computer? Input Devices /output devices
Convolutional neural network based encoder-decoder for efficient real-time ob...
Five Habits of High-Impact Board Members
1 - Historical Antecedents, Social Consideration.pdf
Improvisation in detection of pomegranate leaf disease using transfer learni...
The influence of sentiment analysis in enhancing early warning system model f...
Geologic Time for studying geology for geologist
Custom Battery Pack Design Considerations for Performance and Safety
NewMind AI Weekly Chronicles – August ’25 Week III
sustainability-14-14877-v2.pddhzftheheeeee
Architecture types and enterprise applications.pdf

Webdriver with Thucydides - TdT@Cluj #18

Editor's Notes

  • #2: Bonus pelangatoateastea a fostcaRapoartelearataumultmai bine siEchipa de sales a reusitsaprindanistecontractemaiinteresante.Story Noul Framework – Tocmaidescoperisemframeworkul – am fostchemat de team Lead – new ProjectCand am auzitclientu mi-o picat fata. Probabilatiauzit de ei– Press Association – UK – ceamai mare agentie de presa din anglia
  • #3: Problemele au continuatsaapara…acumatrebuiasaluamdouavariante de rapoartesisa le comaramintreele.generamrapoartemari la fiecare run Nevoie de a vedeadiferenteintrerapoarterapide
  • #6: API - Application programming interface - in term this means it is not language specific. You can write your code in the language of your choice.
  • #9: http://www.oracle.com/technetwork/java/javase/downloads/jdk6downloads-1902814.htmlhttp://maven.apache.org/http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/junosr2
  • #12: http://www.oracle.com/technetwork/java/javase/downloads/jdk6downloads-1902814.htmlhttp://maven.apache.org/http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/junosr2
  • #53: Oxford University Press Aplicatia era un document management system. ProvocariTestare cu 5 tipuri de useriptfiecare flow Jenkins for CISolutiaDDT – Data Driven Testing – un scenariu era rulatpentru 5 tipuri de utilizatorisiasteptamdiferiteoutcomeuri
  • #54: Jenkinseste un tool de continuous integrationContinuous integration (CI) is a software engineering practice in which isolated changes are immediately tested and reported on when they are added to a larger code base.Practiccandechipa de dev face un nou deploy de aplicatieTestelesuntporniteimediatdupa deployRuleazatestelesiai un raport instant… de passed and failed
  • #55: Jenkinseste un tool de continuous integrationPracticcandechipa de dev face un nou deploy de aplicatieTestelesuntporniteimediatdupa deployRuleazatestelesiai un raport instant… de passed and failed