1 / 13

Test Automation Best Practices

Test Automation Best Practices. by Leonard Fingerman Email: esmlf@yahoo.com. Why Automate Testing ?. Improve software quality by reducing time to market Improve reliability and consistency of testing processes

cree
Download Presentation

Test Automation Best Practices

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Test AutomationBest Practices by Leonard Fingerman Email: esmlf@yahoo.com

  2. Why Automate Testing ? • Improve software quality by reducing time to market • Improve reliability and consistency of testing processes • Allow manual testers do more complex & more suited for human kinds of tests (exploratory, usability etc.) • Enforce SLAs (service level agreements) Ultimate goal is to save your business $$$...

  3. Common Types of Automated Testing • Unit Testing (xUnit, TestNG etc) • Performance Testing (LoadRunner, WebLoad etc) Functional System Testing (via UI, API, Web Services or Database) Model-based Regression

  4. Some Functional Automated Test Tools

  5. You selected a tool…now what? • A tool is supposed to do it all, right… ? • Don’t fall into tool vendor’s sales pitch …remember Record & Playback is not real test automation • According to recent IDT study (www.idtus.com)

  6. How to ensure success of TA project Essentially automated test system is a piece of software designed to test your application  treat it as such • Evaluate an automated tool • POC (proof of concept) based on your native apps • Choose a tool that fits your business requirements & technical expertise • Plan • Establish goals & objectives; budget; use or hire competent resources • Be ready to have quality metrics to validate the ROI (return of investment) • Design • Keep in mind the user community of TA system (Usability) • Choose an architecture that reduces maintenance and is extensible • Implement • Practice OOD principles of reusability & modularity (employ encapsulation & abstraction) • Introduce version control of your code • Establish code review process • Test & Maintain • Unit test your code • Constantly re-evaluate reasons for maintenance and improve TA architecture to minimize maintenance

  7. Note: the tool is abstracted by higher-level framework component library

  8. Data-driven automation framework • Automation is data-centric • User defines just data sets to drive tests with • Will have an external data source (DB tables, Excel spreadsheets, XML for data sets) • Flow control (navigation) is normally done by the test script not by the data source Ex: data set exercises creation of new sales accounts functionality; stored in a DB table account_data

  9. RFT code snippet publicvoid testMain(Object[] args) { String name;String primarySalesPerson;String address;String zip;String city;String state; String query = "Select * from account_data";String AccessDBPath = Constants.FL_DB_PATH; //Data abstraction class DataHandler – methods process data and return data values DataHandler dlrAcctData = new DataHandler (AccessDBPath,query); ArrayList listDlrAcctData = dlrAcctData.getRowsOfData(); try { for (int i=0;i<listDlrAcctData.size();i++){ coName = dlrAcctData.getValueForColumnName(i,“CompanyName"); primarySalesPerson = dlrAcctData.getValueForColumnName(i,"primarySalesPerson"); Type.text(CustomerCreate.field_name(),coName ); Click.object(CustomerCreate.image_primarySalesPersonIcon() ); Type.text(text_employeeModalPanelCommonN(),primarySalesPerson); … } dlrAcctData.closeDB(); } …

  10. Keyword-driven automation framework • Automation is action-centric • De-compose your test cases/modules into granular re-usable keywords • The idea is for non-coders to be able to create automated test cases with action keywords • User defines flow control of the test via action keywords Example:Test Case “Verify Checking Account Balance” • Enter Username and Password and Click submit button  step 1 is action Login • Enter “Phil Collins” as a Sales Person andClickSubmit button • Verify the Sales Person was successfully created and Logout So you may want to choose the following re-usable action keywords: EnterText, Click, Login, VerifyExists

  11. Keyword-driven automation framework May have an external data source (DB tables, Excel spreadsheets, XML for data sets) with action keywords e.g.

  12. Hybrid automation framework • Combines the best of both worlds • User defines data sets to drive tests with • User also defines flow control of the test via action keywords • May have an external data source (DB tables, Excel spreadsheets, XML for data sets) with action keywords in addition to generic and test case specific data sets

  13. Q & A

More Related