View
3.405
Download
2
Category
Preview:
DESCRIPTION
This presentation gives an overview of #challenges in #automation , #types of automation #techniques and which #tools to use to achieve it
Citation preview
Continuous Integration using Thucydides
(BDD) with selenium
By : Khyati Shegal Swati Jain
Netherlands | USA | India | France | UK
SOFTWARE DEVELOPMENT DONE RIGHT
www.xebia.in; Blog :http://.xebee.xebia.in
Content
BDD BDD vs TDD JBehave JBehave & Selenium Page Objects Q & A
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
BDD Vs TDD
BDD : $(count)should-be(5) TDD assertEquals(count 5)
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
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
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.
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){;
}
}
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'
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(){ }
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();
}
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
Thucydides Report
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
Contact us @
Xebia India infoindia@xebia.com
Websites www.xebia.in www.xebia.com www.xebia.fr
Thought Leadership Htto://xebee.xebia.in http://blog.xebia.com http://podcast.xebia.com
Recommended