21
Continuous Integration using Thucydides (BDD) with selenium By : Khyati Shegal Swati Jain

Continuous integration using thucydides(bdd) with selenium

Embed Size (px)

DESCRIPTION

This presentation gives an overview of #challenges in #automation , #types of automation #techniques and which #tools to use to achieve it

Citation preview

Page 1: Continuous integration using thucydides(bdd) with selenium

Continuous Integration using Thucydides

(BDD) with selenium

By : Khyati Shegal Swati Jain

Page 2: Continuous integration using thucydides(bdd) with selenium

Netherlands | USA | India | France | UK

SOFTWARE DEVELOPMENT DONE RIGHT

www.xebia.in; Blog :http://.xebee.xebia.in

Page 3: Continuous integration using thucydides(bdd) with selenium

Content

BDD BDD vs TDD JBehave JBehave & Selenium Page Objects Q & A

Page 4: Continuous integration using thucydides(bdd) with selenium

Challenges in Web Automation

Dynamic nature of web pages Ever changing Javascript world and cross browser support

Simulating real user experience Writing automation test at a low level (E.g > click , select )

Robust handling of environment and response slowness

Developer centric test cases

Page 5: Continuous integration using thucydides(bdd) with selenium
Page 6: Continuous integration using thucydides(bdd) with selenium

BDD Vs TDD

BDD : $(count)should-be(5) TDD assertEquals(count 5)

Page 7: Continuous integration using thucydides(bdd) with selenium

Tools we are proposing »Selenium 2.0 (Webdriver) ˃ Advanced browser testing

API »Thucydides >automation framework designed to make it

easier to write automated acceptance tests using Selenium 2.

» Jenkins (Or Any other CI Tool) ˃ To support continuous integration approach

Page 8: Continuous integration using thucydides(bdd) with selenium

Webdriver/Selenium 2.*

»Webdriver is an Advanced API to interact with browser

» Clean API enables to write robust Automation Solution

» Browsers Supported – Firefox, IE, Chrome, Safari, HTMLUnit, Iphone, Android ( Default browsers for Mobile Phones)

» Supports various programming languages – Java, C#, Python, etc

» Java is supported out of the box

Page 9: Continuous integration using thucydides(bdd) with selenium
Page 10: Continuous integration using thucydides(bdd) with selenium

Thucydides

By default, Thucydides supports a simple directory-based convention for organizing your requirements. The standard structure uses

three levels: capabilities, features and stories.

+ src

+ test

+ resources

+ stories

+ grow_potatoes [a capability]

+ grow_organic_potatoes [a feature]

- plant_organic_potatoes.story [a story]

- dig_up_organic_potatoes.story [another story]

+ grow_sweet_potatoes [another feature]

...

If you prefer another hierarchy, you can use the thucydides.capability.types system property to override the default convention.

Page 11: Continuous integration using thucydides(bdd) with selenium

Defining Thucydides Page Objects

Page Objects are a way of isolating the implementation details of a web page inside a class, exposing only business-focused methods related to that page

Example :-

public class LoginPage extends PageObject {

public LoginPage(WebDriver driver) {

super(driver);

}

@FindBy(id = "username")

private WebElement userName;

@FindBy(css = "button.button")

private WebElement loginButton;

public void inputForm(String username, String password) {

}

public void submitForm() {

}

public void logOut() {

}

public String getResultValue(String value){;

}

}

Page 12: Continuous integration using thucydides(bdd) with selenium
Page 13: Continuous integration using thucydides(bdd) with selenium

Stories Narrative: In order to configure on the THM DashBoard As an Admin I want to be able to login to the Dashboar Scenario: Logging in as Admin Given I am on Login Page When I input 'admin' and 'alfresco' as Username And

Password Then I Click Login Button Then I should see 'logout'

Page 14: Continuous integration using thucydides(bdd) with selenium

Defining the Test Steps public class LoginSteps extends ScenarioSteps { LoginPage loginPage; @Step public void enters() { loginPage.navigateTo(getDriver()); } @Step public void provides_credentials(String username, String password) { loginPage.inputForm(username, password); } @Step public void click_button() { } @Step public void LogOut(){ }

Page 15: Continuous integration using thucydides(bdd) with selenium

Step Class public class LoginTest {

@Steps

LoginSteps login;

@Given("I am on Login Page")

@Alias("the admin is not logged in")

@Then("I am on Login Page")

public void givenIAmOnLoginPage() {

login.enters();

}

@When("I input '$username' and '$password' as Username And Passoword")

public void whenIInputUsernameAndPasswordAsUsernameAndPassoword(String username, String password) {

login.provides_credentials(username, password);

}

@Then("I Click Login Button")

public void thenIClickLoginButton() {

login.click_button();

}

Page 16: Continuous integration using thucydides(bdd) with selenium

Jenkin Set Up Jenkins is an open source application which provides continuous

integration services for software development.

Jenkins focuses on the following two jobs:

1.   Building/testing software projects continuously, 2.   Monitoring executions of externally-run jobs Command to run test cases :- mvn clean install -Dstory.timeout.in.secs=30000

Page 17: Continuous integration using thucydides(bdd) with selenium
Page 18: Continuous integration using thucydides(bdd) with selenium

Thucydides Report

Page 19: Continuous integration using thucydides(bdd) with selenium
Page 20: Continuous integration using thucydides(bdd) with selenium

Knowledge Sharing: Speakers in national and international conferences

Functional automation Tools: Selenium/Webdriver, AUTO IT, SoapUI, QTP

Language Proficiencies: Java, Ruby, Groovy, Python

ATDD Tools: Cucumber, Fitnesse, JBehave, Geb

Performance Testing Tools: JMeter, LoadUI

Mobile Testing: Appium, Calabash

Agile Testing

Automation Frameworks in place

-  Selenium/Webdriver keyword driven -  SoapUI

Current Competencies

Page 21: Continuous integration using thucydides(bdd) with selenium

Contact us @

Xebia India [email protected]

Websites www.xebia.in www.xebia.com www.xebia.fr

Thought Leadership Htto://xebee.xebia.in http://blog.xebia.com http://podcast.xebia.com