automation-testing

make release even better

Created by Howard.Zuo / @Howard.Zuo

What is automation-testing

A special software (separate from the software being tested) to be used controlling the execution of tests and the comparison of actual outcomes with predicted outcomes.

It covers some repetitive but necessary tasks in a formalized testing process already in place, or add additional testing that would be difficult to perform manually.

It is critical for continuous delivery and continuous testing.

Why automation-testing

It is a challenge for any company to continuously maintain and improve the quality and efficiency of software systems development.

What we do for bug fix?

Bug fix in working module, how will you ensure that the new bug fixes have not introduced any new bug in previous working functionality?

Highly simultaneous interactions?

How will you simulate highly simultaneous interactions, have thousands tester interact with the website in same time?

Logic changes frequently?

With almost the same GUI but functional changes are more, challenge for your eyes!

Coverage

  • Regression test
  • Different platforms or with different configurations
  • Data-driven testing (creation of tests using the same actions but with many different inputs)

Motivation

Manual testing can be mundane, error-prone and therefore become exasperating
With automation-testing, testers can now concentrate on more difficult test scenarios

Risks associated in automation-testing

  • Required skilled resources
  • Initial cost is high
  • Not fit for extensive changed UI case
  • Not fit for unstable application
  • Not fit for one-time application
  • Impossible replace all manually tests

Web Testing Tools

Try Selenium locally

Prerequisites

Source Code: selenium-example

public class ChromeDriverTest {

    private String testUrl;
    private WebDriver driver;

    @Before
    public void prepare() {
        //setup chromedriver
        System.setProperty(
                "webdriver.chrome.driver",
                "webdriver/chromedriver");

        testUrl = "http://leftstick.github.io/";

        // Create a new instance of the Chrome driver
        driver = new ChromeDriver();

        //set window size
        driver.manage().window().setSize(new Dimension(1300,1000));

        // And now use this to visit myBlog
        // Alternatively the same thing can be done like this
        // driver.navigate().to(testUrl);
        driver.get(testUrl);
    }

    @Test
    public void testTitle() throws IOException {

        // Find elements by attribute lang="READ_MORE_BTN"
        List<WebElement> elements = driver
                .findElements(By.cssSelector("[lang=\"READ_MORE_BTN\"]"));

        //Click the selected button
        elements.get(0).click();

        assertTrue("The page title should be chagned as expected",
                (new WebDriverWait(driver, 3))
                       .until(new ExpectedCondition<Boolean>() {
                           public Boolean apply(WebDriver d) {
                               return d.getTitle().equals("以BDD手写依赖注入");
                           }
                       })
        );
    }

    @After
    public void teardown() throws IOException {
        driver.quit();
    }

}
						

Try Sikuli

Try Sikuli

Mobile Testing Tools

Have fun

Thanks for watching