Your SlideShare is downloading. ×
Alliance Successful Selenium Automation
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Alliance Successful Selenium Automation

919
views

Published on

How to develop a successful Selenium Automation Program

How to develop a successful Selenium Automation Program


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
919
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
29
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. How to develop a successful SeleniumAutomation ProgramDave Rader - CTOSreekanth Singaraju – VP of Testing ServicesDATE: 6/28/2012
  • 2. About AllianceAlliance Global Services is a software development firm that partners withsoftware, technology and information-intensive businesses on their mission-critical work.We plan, design, architect, build, test and implement software applications,platforms and products that become a primary driver of innovation and revenuegrowth for our clients’ businesses.We are recognized for driving quality and speed-to-market when businesssuccess depends on the software inside. We operate agile development centers in the United States and Hyderabad, India and have over 650 employees We have partnered with more than 400 innovative clients in the Information Services, Software and Technology, Insurance and Healthcare industries 2
  • 3. Agenda• Definition of success• Impediments in Achieving Best in Class Automation• Challenges & Solutions for Selenium Automation• Key Takeaways• Titanium xAFT Overview 3
  • 4. Definition of Success for an Automation Program Identifies defects of significance Effective and adopted by Developers & TestersThe framework should be of lowmaintenance and should not take Maintainsignificant effort to handle routinue ablechanges to AUT Automated test execution produces Robust consistent and provable results. Can be leveraged on different Re- releases, configurations & Usable environments. Test Ability to run Automated test scripts Independ ence cases in any order. Delivers measurable value in terms of decreased cycles of ROI execution, decreased effort and improved quality 4
  • 5. Impediments to Achieving Best in Class AutomationObjectives Non-existent or Unrealistic automation objectives Focused around technical goals rather than business goalsAutomation Highest automation ROI areas not identifiedStrategy Subscale initiatives or insufficient commitmentStart-Up Tool licenses and framework creation costsCosts Up front Labor cost for implementing test casesExpertise & Manual test teams lack development expertiseAssets Knowledge of test case lifecycle mgmt. missingMeasuring Lack of a metrics program to measure alignment with overall objectivesEffectiveness Evaluate effectiveness of testing programs and fine-tune strategy 5
  • 6. Challenges with Selenium AutomationObject Ability to identify Objects and manage them to limit the expenseReferences and effort to maintain updates to UICoding Develop scripts in a consistent and maintainable format forStandards easy maintenance and effective executionReporting Provide commercial quality reporting that enables testers to rapidly identify risks inherent in software and provide information to developers towards remediationFramework Implement a framework and process that will streamline management of common elements and resources in automation developmentExpertise & The ability to develop and maintain effectively automation andSkillset related assets to deliver ROI on automation investments 6
  • 7. UI Object ReferenceMost of the Commercial automation tools have the provision to create and manage UI objectsin a centralized repository. Selenium has limited tools to address this leading to high-maintenance scripts • Object reference created using XPATH, ID, Name, Class or CSS. Common mistakes in constructing Object references • Improper selection of Object selection property type • Duplicate references to same objects • Full length XPATH from root used for object identification • Leading to brittle references that break when minor changes to UI are implemented • Significant maintenance effort when UI is redesigned //html/body/div/div/div[2]/ui/div/div[2]/div/h2/a 7
  • 8. UI Object Reference – Recommendations • Utilize common stored location for objects using logical names • Use Key-Value-Pair combination for Logical name and Object identification • Logical hierarchies to group objects for same features at the same place • Recommend UI developers use frameworks that provide unique identifiers for controls • Use the smart identification mechanism and use the optimized XPATH //div[@id=’icon-edit’/h2/a 8
  • 9. Coding PracticesTest engineers that perform script development on Selenium may not have formaldevelopment training leading to common coding errors. These lead to expensive maintenancewhen the scripts need to be updated or unexplained behavior for execution • Not using a design pattern or development strategies to selenium.type("name=j_username", develop framework and scripts "user1"); selenium.type("name=j_password", "user123); • No exception catching block in selenium.click("divdiv[1]spanlogin the coding "); Thread.sleep(30000); • Use of Objects reference such as selenium.click("class=Compose_Email"); path/xPATH in the code • Use of hard coded values for the data for inputs and validation 9
  • 10. Coding Practices – Recommendations • Using a design pattern and development strategies like Page Object Model OR Domain Driven Designtry {//Login to the system and Verify Email • Utilize code style/quality checkingselenium.type(userNameLocator,userNamevalue); tools to address:selenium.type(passwordLocator,passwordvalu • Exception handlinge);selenium.click(loginLocator); • Commenting • Hard codingselenium.isTextPresent(welcomeText);} catch (Exception e) { • Use reusable coding practices forLogger.Debug(("Element :["+ welcomeText+"not found" + handling input data, validations,"continuing text execution")); object references and commonselenium.click("Compose_Email"); library functions} • Utilize reference based object synchronization for script to synchronize with the app 10
  • 11. Reporting & MetricsMost of the Commercial automation tools provide extensive reporting functionality is notavailable in Selenium and needs to be developed • Poring over logs to identify exceptions is time consuming and error prone • Execution metrics such as coverage, script effectiveness etc help fine-tune framework • Test Execution meta data such as environments, browsers, pass/fail etc need to be extracted from the basic logs • Mapping of pass/fail data to validation points needs to be created • Fatures such as screenshots are completely missing 11
  • 12. Reporting & Metrics • Multiple levels of logging for easy debugging and analysis • Drill down Test Result reports • Automatic Emailing the Test Result Reports • Test Result Report Integration with Test Case Management Tools • Screenshot capture on every step or on exception • Defect identification effectiveness, designed coverage and traceability to features 12
  • 13. Automation FrameworkPoorly designed automation frameworks only transfer inefficiencies from scripts to theframework while providing limited benefits An example of a poorly designed framework: • Poor architecture design limiting Automation flexibility of choosing target Framework: Target browsers, target environments Browsers, Test Data, and test data suites Object References, • Lack of standards and guidelines Reusable Functions, for reusable functions, Exception Handling, components and object references Reporting • Reporting features limited to logs from Selenium • Weak governance leading to diluted framework effectiveness 13
  • 14. Automation Framework • Framework should be application- independent. Configuration • Easy to expand, maintain, and Files perpetuate as the underlying application changes • Generic functionality like navigation, API Support Test Data link checking, login/logout and reports should be developed as Application reusable functions Specific Business Functions • Business functionality will be addressed in test scripts/suites Logging and Object • Test Data treated as a separate Reporting Repository input into scripts • Implement support for Windows File Generic and Authentication dialogs Functions • Scripts should have minimal external dependencies from: – Browser versions – Target environments 14
  • 15. Expertise & SkillsetCurrently there are a lot of good developers and good testers – but it is very hard to find goodautomation Engineers that can develop effective automation Developers • Facilitate the creation of automation testers by Automation creating a cross Engineer functional/technical Tester training • Support them with robust automation frameworks and reusable assets • Ultimately Expensive to hire, maintain and retain resources 15
  • 16. Key Take AwaysExisting Run scripts on more than one browserAutomationProgram Run Sonar and identify code quality issues Metrics and reports from framework Validate scripts can run multiple data conditions with no code changes Change IDs for a few UI controls and evaluate impact on scripts Governance and process on managing frameworkNew Review off-the-shelf automation frameworks first before building fromAutomation scratchProgram 16
  • 17. Titanium xAFT OverviewxAFT is a Selenium based Automation tool to test web based applications from anExcel worksheet using English like language. allianceglobalservices.com/innovation Based on Open and proven 30% productivity technologies improvements over Selenium automation Flexible & Maintainable framework Execute scripts from Excel Across browsers Titanium xAFT (eXcel Automated Functional Tester) is a and web services robust enterprise automation framework that enables technical and non-technical users to manage and leverage automation suites Web Mobile WebServices 17
  • 18. Thank You 18

×