1 / 45

Test Automation: Coded UI Test

Test Automation: Coded UI Test. Jan 25 th 2013 . Introduction Internal Class Structure (Generic Structure) Program architecture Framework function Demo Reliability Usability & Reusability Efficiency Build Process in the Future. Introduction

brent
Download Presentation

Test Automation: Coded UI Test

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 Automation:Coded UI Test Jan 25th 2013

  2. Introduction • Internal Class Structure (Generic Structure) • Program architecture • Framework function • Demo • Reliability • Usability & Reusability • Efficiency • Build Process in the Future

  3. Introduction • Internal Class Structure (Generic Structure) • Program architecture • Framework function • Demo • Reliability • Usability & Reusability • Efficiency • Build Process in the Future

  4. Automated Testing • Ensures you don’t miss out on running a test • Can actually enforce and drive clean design decisions • Have training value

  5. Coded UI Test • Automated tests that drive your application through its user interface (UI) are also known as coded UI tests (CUITs). • These tests include functional testing of the UI controls. They let you verify that the whole application, including its user interface, is functioning correctly. • Coded UI Tests are particularly useful where there is validation or other logic in the user interface, for example in a web page. They are also frequently used to automate an existing manual test.

  6. Coding Process with Coded UI Test • Test Cases • Recording the actions • Coding with testing strategies • Auto-compile and run • If tests fail • Fault in test script-> make appropriate modifications • Bug in the application -> report (PFOOTB) • If tests pass -> move ahead They are fun and challenging to write One has to carefully think of design for reusability and coverage

  7. Recording the actions Coded UI Test Builder The Coded UI Test builder enables you to record actions and add them into your existing Coded UI Test Generate code Add assertion Show recorded steps Start recording

  8. Understanding the tests • Test Window • Test View window • Test List Editor

  9. Identify Portal Framework Defects • Bugs can be identified by Coded UI Test Habanero Portal Framework Out Of The Box

  10. Identify Portal Framework Defects • Bugs cannot be identified by Coded UI Test Habanero PF Habanero OOTB

  11. Introduction • Internal Class Structure (Generic Structure) • Program architecture • Framework function • Demo • Reliability • Usability & Reusability • Efficiency • Build Process in the Future

  12. UI Map Class • The real work takes place • An assortment of supporting classes are generated • Class diagram helps you to understand the relationships and the classes • involved.

  13. Generic Library • Using the auto-generated code in designer.cs Class is very inefficient • Construct an efficient, reusable, beautiful libraries

  14. Even More Generic

  15. Class Diagram • Document Library • List • Calendar • Page • Asset

  16. Introduction • Internal Class Structure (Generic Structure) • Program architecture • Framework function • Demo • Reliability • Usability & Reusability • Efficiency • Build Process in the Future

  17. The Automated Test Framework

  18. Program Pattern

  19. Introduction • Internal Class Structure (Generic Structure) • Program architecture • Framework function • Demo • Reliability • Usability & Reusability • Efficiency • Build Process in the Future

  20. Framework function • These framework functions will be documented in our Habanero QA site or visit QA site: https://h.habaneros.com/teamsites/QA/Lists/Framework%20Functions/AllItems.aspx

  21. Introduction • Internal Class Structure (Generic Structure) • Program architecture • Framework function • Demo • Reliability • Usability & Reusability • Efficiency • Build Process in the Future

  22. Demo I will run the following tests if time permits: • ContentPF • Test Cases: 1. Add content to a page • 2. Edit the content of a page • 3. Apply a markup style to content on a page • 4. Edit the HTML of the content on a page • ListInheritancePF • Test Cases: 1. Break inheritance on a list • 2. Break inheritance on a single list item • ListWorkflowPF • Test Cases: 1. Define a workflow for a list • 2. Perform workflow on a list item • PagePF • Test Cases: 1. Create new page • 2. Modify page properties • 3. Check in/ Check out a page • 4. Delete a page • 5. Email a link to a page

  23. Introduction • Internal Class Structure (Generic Structure) • Program architecture • Framework function • Demo • Reliability • Usability & Reusability • Efficiency • Build Process in the Future

  24. Reliability • Controls & Actions • Ensure the program find the correct controls • Ensure the actions get executed • Unstable Tests • Some tests may wander between Pass and Fail • Use Meaningful name • helps identify the purpose of the method • Limit each recorded method to fewer than 10 actions • Makes it easier to replace a method if the environment changes • Use the data from app.config file instead of hardcoding the data • Increase the reliability of making an assertion

  25. Introduction • Internal Class Structure (Generic Structure) • Program architecture • Framework function • Demo • Reliability • Usability & Reusability • Efficiency • Build Process in the Future

  26. Usability & Reusability • Coded UI Tests are completely reusable • Need to setup a continuous integration server • Create libraries as the codebase • Customize Search Properties • Overwrite Search properties with parameters • Customize Complete Functions • Atomic Tests • Tests are not depend on other tests • Reusable modules (The BaseTest Class) • Common test functions

  27. Customized Search Properties

  28. Customized Search Properties

  29. Customized Functions

  30. Customized Methods

  31. Introduction • Internal Class Structure (Generic Structure) • Program architecture • Framework function • Demo • Reliability • Usability & Reusability • Efficiency • Build Process in the Future

  32. Efficiency • Web Page Navigation

  33. Efficiency • Eliminate Delay

  34. Efficiency • Add Delay Sometimes, the control runs faster than the web browser

  35. Introduction • Internal Class Structure (Generic Structure) • Program architecture • Framework function • Demo • Reliability • Usability & Reusability • Efficiency • Build Process in the Future

  36. Test Cases Coded UI Test Build Process TFS MTM Client Projects

  37. Build Process At this point, we have created numerous Test Cases. We can execute a Coded UI Test Case simply by taking the compiled assembly and executing it with Visual Studio or MSTest from the command line, which require us to sit there and do nothing while the test executes Another way: Associate Coded UI Tests and Test Cases Run the tests from Microsoft Test Manager Test Cases

  38. MSTest

  39. Associating Coded UI Tests and Test Cases (TFS)

  40. Microsoft Test Manager

  41. Next Step ( a typical way) • Set Up Team Build • With correct build definition and configuration • So that the automated test can be found in the share location for the • build definition and then it can be run from MTM • Create Test Settings and Virtual (Physical) Environment • We cannot run Coded UI Tests using MTM without an environment • Create an environment that contains the roles in the test settings and then use this environment in the test plan

  42. Sometimes, things don’t work the way you want it to be.

  43. If you have any comments on the coded UI test, feel free to let me know  Thank you

More Related