Automation Testing

1,124 views
963 views

Published on

Demo with Selenium Web Driver & Jenkins as Integration Server

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,124
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Automation Testing

  1. 1. ConsultingServicesApplicationDevelopmentTechnologyIntegrationDemo with Selenium WebDriver &Jenkins as Integration ServerBrindusa GamaniataPaul Brodner
  2. 2. Selenium WebDriver◦ Introduction◦ Installation details◦ IDE & test environment configuration◦ DemoJenkins◦ Introduction◦ Configuration Setup◦ Selenium WebDriver test integration with Jenkins◦ Second approach (Selenium WebDriver, Jenkins &Ruby)2
  3. 3. No, I’m not referring to the chemical element:Is an open source frameworkProvides a set of different tools for testautomation◦ Selenium IDE◦ Selenium Grid◦ Selenium 1 (Selenium RC or Selenium Remote Control)◦ Selenium 2 (Selenium WebDriver)3
  4. 4. 2. Install Java1. Download SeleniumSelenium Client Drivers◦ http://seleniumhq.org/download or◦ https://code.google.com/p/selenium/Download Java libraries(.jar files)Download Java JDK fromthe following location:◦ http://www.oracle.com/technetwork/java/javase/downloads/index.html
  5. 5. 2. Add Home to Path1. Download AntDownload Apache Ant◦ http://mirrors.hostingromania.ro/apache.org//ant/binaries/apache-ant-1.9.1-bin.zip◦ Ant is the abbreviation forAnother Neat Tool ☺☺☺☺Add environment variables◦ set ANT_HOME=C:apache-ant-1.9.1◦ set JAVA_HOME=C:jdk1.6.0_24◦ set PATH=%ANT_HOME%bin;%JAVA_HOME%bin
  6. 6. 2. New Project1. Download EclipseDownload Eclipse IDE forJava Developers◦ http://www.eclipse.org/downloads/index-helios.phpCreate a new project◦ File>New>Project
  7. 7. 1. Locate the element on the page using Firebug orDevelopers Tools7
  8. 8. 2. Choose how you will identify the element• By idselenium.findElement(By.id (“search”));• By xpath• Locate the element using his attributesselenium.findElement(By.xpath (“//input[@id=‘search’]”));• Locate the element using the previous element. This is useful when we have multipleelements with the same attributesselenium.findElement(By.xpath (“//fieldset/span/input[@id=‘search’]”));3. Interact with the elementBy searchLocator = By.xpath( “//fieldset//input[@id=‘search’]”);WebElement searchInput = selenium.findElement(searchLocator);String searchedText = “testing”;searchInput.sendKeys(searchedText);8
  9. 9. We can use assert methods:◦ assertEquals(expected, actual);◦ assertTrue(actual);◦ assertFalse(actual);◦ assertNull(actual);◦ assertNotNull(actual);Related to our previous exampleString actualText = searchInput.getText()assertEquals(“testing”, actualText);9
  10. 10. 10DEMODEMODEMODEMO((((WebDriverWebDriverWebDriverWebDriver ---- Java approach)Java approach)Java approach)Java approach)
  11. 11. Pickels ?◦ Based on Cucumber http://cukes.info/ (Making BDD fun)◦ Watir (Web Application Testing in Ruby) http://watir.com/◦ and other useful libraries all in one package11
  12. 12. How to use it ?◦ You must know Ruby language◦ You can have access to Watir Api documentationhttp://wtr.rubyforge.org/rdoc/1.6.5/◦ Learn using the example provided by pickels◦ You will create tests using Model based approach12
  13. 13. Demo13
  14. 14. Continuous Integration ServerAutomate a specific taskSelf test a specific build after commitMaintain a build history of test resultsEasy to configure and extend (using plugins)Supports Revision Controls tools (Subversion, Git,Perforce)Much more https://wiki.jenkins-ci.org/display/JENKINS/Meet+Jenkins14
  15. 15. 2. Open the Interface1. Download JenkinsDownload Jenkins nativepackages◦ Windows, Linux, Mac(http://jenkins-ci.org/)Open in browser◦ localhost:8080
  16. 16. 4. Create Job3. Install PluginsInstall you plugins◦ http://localhost:8080/pluginManager/?◦ Manage Jenkins -> PluginManagerPlugins examples:◦ Ant◦ Subversion◦ Cucumber Reports◦ AnsiColorNew Job – Test ISTC Demo
  17. 17. 17DEMODEMODEMODEMO(Jenkins)(Jenkins)(Jenkins)(Jenkins)
  18. 18. http://docs.seleniumhq.org/docs/03_webdriver.jsphttp://code.google.com/p/selenium/wiki/GettingStartedhttp://ant.apache.org/manual/using.htmlhttps://wiki.jenkins-ci.org/display/JENKINS/Meet+Jenkinshttp://jenkins-ci.org/http://wtr.rubyforge.org/rdoc/1.6.5/18
  19. 19. 19Thanks for watching!Thanks for watching!Thanks for watching!Thanks for watching!

×