Selenium intro part1 ide overview
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Selenium intro part1 ide overview

on

  • 475 views

Course Description ...

Course Description
Within fast moving agile software development teams it becomes important to test user interfaces as they are being coded. Automated Testing techniques using Selenium 2 allow for test replay of important features as development progresses. Selenium IDE and Selenium Web Driver are important tools for any tester or developer to use in ensuring software quality and making changes with confidence. This interactive, hands-on workshop provides an understanding and advanced techniques in the use of Selenium 2 with hands on practice. The practice exercises are tailored to various skill levels and type of application being tested, from simple forms to complex web applications.
Objectives:
The class will teach participants to:
Understand trade-offs of automated vs. manual testing.
Record, edit and play back Selenium IDE tests against multiple types of web applications.
Minimize test failure due to normal changes to code.
Understanding of basic Selenium commands to get through common issue with web applications.
Use of Eclipse to run tests individually and as a group to generate test failure reports.
Learn how to help developers understand the importance of making applications more testable to improve usability.

Topics:

Overview of automated testing
Selenium Suite Overview
Selenium 2 Limitations
Selenium IDE
HTML Locator strategy and false test failure
Firefox Firebug and reading HTML
Selenium Web Driver setup
Eclipse and JUnit (Don't Panic it's just code)
Convert Selenium IDE tests into Selenium 2 Java WebDriver tests
Working with unsupported commands from Selenium IDE
Dealing with security and certificates
Selenium Web Driver practice workshop
Learn how to test in multiple browsers and generate metrics and reports
Discussion of setting up Selenium Web Driver for continuous integration

Bonus Features:

Sample Selenium Web Driver code
Scripts to run JUnit test suites on multiple browsers and generate reports and metrics
List of web resources and blogs for reference
Laminated CSS selector cheat sheet
Laminated Selenium 2 command reference
Courses Offered in Our Training Institute:

1)Msbi
2)Dotnet
3)SharePoint 2010
4)Testing TOOLs - QTP, QC , Load Runner, Selenium
5)SQL SERVER


Visit for the course Details www.mindqonline.com
Mail us for details: online@mindqsystems.com
Call me at: +91-9502991277.

Statistics

Views

Total Views
475
Views on SlideShare
475
Embed Views
0

Actions

Likes
0
Downloads
9
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Selenium intro part1 ide overview Presentation Transcript

  • 1. IDE OverviewIDE Overview SeleniumSelenium HP Web Test Tool TrainingHP Web Test Tool Training Mindq systemsMindq systems www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 2. 22 Selenium OverviewSelenium Overview Selenium IDE IntroductionSelenium IDE Introduction www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 3. What is Test Automation?What is Test Automation?  A process of writing a computer program to doA process of writing a computer program to do testing that would otherwise need to be donetesting that would otherwise need to be done manuallymanually  Use of software to control the execution of testsUse of software to control the execution of tests Two types of test automation:Two types of test automation:  Code-driven testingCode-driven testing  Graphical user interface testingGraphical user interface testing 33www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 4. Advantages of AutomationAdvantages of Automation  Reliable: Tests perform precisely the same operationsTests perform precisely the same operations each time they are run, thereby eliminating human error.each time they are run, thereby eliminating human error.  Repeatable: You can test how the software reacts underYou can test how the software reacts under repeated execution of the same operations.repeated execution of the same operations.  Reusable: You can reuse tests on different versions ofYou can reuse tests on different versions of an application, even if the user interface changes.an application, even if the user interface changes.  Speed: Run tests significantly faster than human users.Run tests significantly faster than human users.  Cost Reduction: As the number of resources forAs the number of resources for regression test are reduced.regression test are reduced.  Better Quality Software: Rapid feedback to developersRapid feedback to developers during the development process as a result of frequentduring the development process as a result of frequent regression testing.regression testing. 44www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 5. Disadvantages of AutomationDisadvantages of Automation  Proficiency is required to write the automation test script.Proficiency is required to write the automation test script.  Debugging the test script is major issue. If any error isDebugging the test script is major issue. If any error is present in the test script, sometimes it may lead to dadlypresent in the test script, sometimes it may lead to dadly consequences.consequences.  Test maintenance is costly in case of playback methods.Test maintenance is costly in case of playback methods. Even though a minor changes occurs in the GUI, the testEven though a minor changes occurs in the GUI, the test script has to be rewritten.script has to be rewritten.  Maintenance of test data files is difficult, if the test scriptMaintenance of test data files is difficult, if the test script tests more screens or web-pages.tests more screens or web-pages.  Short iteration or very tight deadline, there is not enough time to build test automation. www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 6. What is Selenium?What is Selenium? A set of tools that supports rapid development of testA set of tools that supports rapid development of test automation for web-based applications.automation for web-based applications.  Can be recorded and written as HTMLCan be recorded and written as HTML  Support for a number of programming languages: Java,Support for a number of programming languages: Java, C#, Perl, PHP, Python, RubyC#, Perl, PHP, Python, Ruby  Cross browsers support: IE, Firefox, Opera, Safari andCross browsers support: IE, Firefox, Opera, Safari and Google ChromeGoogle Chrome  Cross platform support: Windows, Linux, and Macintosh.Cross platform support: Windows, Linux, and Macintosh. 66www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 7.  Invented in 2004 by Jason R. Huggins and team.Invented in 2004 by Jason R. Huggins and team.  Originally named JavaScript Functional Tester [JSFT]Originally named JavaScript Functional Tester [JSFT]  100% Javascript and HTML100% Javascript and HTML  Designed to make test writing easyDesigned to make test writing easy  Open source browser based integration test frameworkOpen source browser based integration test framework built originally by ThoughtWorksbuilt originally by ThoughtWorks  Selenium is open source software, released under theSelenium is open source software, released under the Apache 2.0 license and can be downloaded and usedApache 2.0 license and can be downloaded and used without charge.without charge. Selenium BackgroundSelenium Background www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 8. Selenium TriviaSelenium Trivia 88 Selenium is a chemical element with the atomic number 34, represented by the chemical symbol Se. Selenium is used for treating Mercury poisoning Products: QTP, WinRunner, LoadRunner and TestDirector Selenium Mercury www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 9. Selenium ComponentsSelenium Components  Selenium IDESelenium IDE  Selenium RCSelenium RC  Selenium GridSelenium Grid  Selenium2 akaSelenium2 aka WebdriverWebdriver 99 < < Selenium Core< < Selenium Core www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 10. Selenium IDESelenium IDE  Selenium IDE (SIDE) is a complete IntegratedSelenium IDE (SIDE) is a complete Integrated Development Environment (IDE) for building SeleniumDevelopment Environment (IDE) for building Selenium test case.test case.  Firefox add-on that makes it easy to record, edit, andFirefox add-on that makes it easy to record, edit, and debug tests.debug tests.  Provides an easy-to-use interface for developing andProvides an easy-to-use interface for developing and running individual test cases or entire test suites.running individual test cases or entire test suites.  Can be used to generate code to run the tests withCan be used to generate code to run the tests with Selenium Remote Control (RC).Selenium Remote Control (RC). 1010www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 11. Selenium IDE FeaturesSelenium IDE Features  Record, playback, edit  Intelligent component identification will use object IDs, names, or XPath as needed  Auto complete for all common Selenium commands  Walk through test cases and test suites.  Debug and set breakpoints  Save tests as HTML, or export as other supported programming languages  Support for Selenium user extensions 1111www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 12. 1212 Installing Selenium IDEInstalling Selenium IDE www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 13. Installing Selenium IDEInstalling Selenium IDE 1313 Two step process:  Step 1. Check if Firefox is installed 1a. If Firefox is not installed on your machine then Install Firefox (There is NO IE Version of Selenium)(There is NO IE Version of Selenium)  Step 2. Check if Selenium IDE is installed) 2a. If Selenium IDE is not installed on your machine then Install Selenium IDE Plug In www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 14. Step 1: Is Firefox Installed?Step 1: Is Firefox Installed?  Check whether your machine already has a version ofCheck whether your machine already has a version of Firefox installed.Firefox installed.  Go to StartGo to Start  ProgramsPrograms  Mozilla FirefoxMozilla Firefox 1414www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 15. Step 1: Check Firefox VersionStep 1: Check Firefox Version  Click on the Mozilla FirefoxClick on the Mozilla Firefox  Go to HelpGo to Help  About as shown below:About as shown below:  Check the version nameCheck the version name  What is your version?What is your version? 1515 Must be Firefox version 3.x.x.xx not 4.x.x.xx www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 16. Step 1a: Firefox InstallationStep 1a: Firefox Installation  Open your IE browser (or any other browser)Open your IE browser (or any other browser)  Navigate to Firefox 3.6 download link.Navigate to Firefox 3.6 download link. http://www.oldapps.com/firefox.php?old_firefox=109?downloadhttp://www.oldapps.com/firefox.php?old_firefox=109?download WARNING!!!!!WARNING!!!!!  Mozilla website will not haveMozilla website will not have Firefox 3.6 download link.Firefox 3.6 download link. The most current browser version will be presented.The most current browser version will be presented. (FF 4.0)(FF 4.0) 1616www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 17. Step 1a: Firefox InstallationStep 1a: Firefox Installation 1717www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 18. Step 1a: Firefox InstallationStep 1a: Firefox Installation  Follow the steps and run the program (*1)Follow the steps and run the program (*1) (Saving into local machine then running is recommended)(Saving into local machine then running is recommended)  If prompted with Security warning, press “Run” button (*2If prompted with Security warning, press “Run” button (*2 & *3)& *3) 1818 *1 *2 *3 Save into your local machine. (C:Downloads) Run (double click Firefox Setup 3.x.x) from the location where you downloaded Ignore Security warning and press “Run” button www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 19. Step 1a: Firefox InstallationStep 1a: Firefox Installation  Press Next (*1)Press Next (*1)  Check the “I Accept” then Press Next (*2)Check the “I Accept” then Press Next (*2)  Select Standard, Remove check from “Use Firefox as mySelect Standard, Remove check from “Use Firefox as my default browser” (*3)default browser” (*3)  Press Install button (*4)Press Install button (*4)  Press Finish button (*5)Press Finish button (*5) 1919 *1 *2 *3 *4 *5 www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 20. Step 2: Is Selenium IDE Installed?Step 2: Is Selenium IDE Installed?  Open the Firefox browser window (*1)Open the Firefox browser window (*1)  Go to ToolsGo to Tools  Check whether Selenium IDE alreadyCheck whether Selenium IDE already exist there (*2)exist there (*2)  If you see “Selenium IDE” then you already havingIf you see “Selenium IDE” then you already having Selenium IDE plug-in installed in Firefox browser.Selenium IDE plug-in installed in Firefox browser.  If not installed then follow the instruction on the next slideIf not installed then follow the instruction on the next slide 2020 *1 *2 Check whether Selenium IDE is already installed www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 21. Step 2a: Installing Selenium IDEStep 2a: Installing Selenium IDE  Open the Firefox browser windowOpen the Firefox browser window  In the navigation tool bar type the below URL:In the navigation tool bar type the below URL: http://seleniumhq.org/download/http://seleniumhq.org/download/  Click the Download link next to Selenium IDE projectClick the Download link next to Selenium IDE project name.name. 2121 Don’t do this in IE Click Download www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 22. Step 2a: Installing Selenium IDEStep 2a: Installing Selenium IDE 2222 Or you can find Selenium IDE downloads in Previous Releases directory: 1. Previous Releases 2. Selenium IDE 3. Version 1.0.10 www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 23. Step 2a: Installing Selenium IDEStep 2a: Installing Selenium IDE  When the Software Installation Window opens selectWhen the Software Installation Window opens select “selenium-ide” (*1)“selenium-ide” (*1)  Click Install Now buttonClick Install Now button  ““Selenium IDE” add-on is installed (*2)Selenium IDE” add-on is installed (*2)  Click on “Restart Firefox” buttonClick on “Restart Firefox” button 2323 *1 *2 Restart Firefox for Selenium Plug-in to take effect www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 24. Step 2a: Installing Selenium IDEStep 2a: Installing Selenium IDE In the Firefox browser go to Tools and verify whetherIn the Firefox browser go to Tools and verify whether “Selenium IDE” is displayed.“Selenium IDE” is displayed. Congratulation! Selenium IDE installation is completed.Selenium IDE installation is completed. 2424 Selenium IDE is successfully installed www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 25. 2525 Recording and RunningRecording and Running Selenium TestsSelenium Tests www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 26. Test Case #1: LoginTest Case #1: Login Test-Case Objective: Ensure Valid User Login Expected Result:Expected Result: 1.OrangeHRM index page is loaded 2.Correct username is displayed as part of the greeting. “Welcome Admin” 2626 Steps : 1. In the login textbox type “admin”. 2. In the password textbox type “password”. 3. Click “Submit” button 4. Verify that a correct user name is displayed 5. Log out www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 27. Test Script #1: LoginTest Script #1: Login Test Script Steps:Test Script Steps: Open OrangeHRM application in FirefoxOpen OrangeHRM application in Firefox http://hrm.phttp://hrm.portnov.comortnov.com  Login using :Login using : Login Name: adminLogin Name: admin Password: passwordPassword: password  Click Login buttonClick Login button  Highlight “Welcome Admin” textHighlight “Welcome Admin” text  Right-click and select VerifyTextPresentRight-click and select VerifyTextPresent  Click logout linkClick logout link 2727www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 28. Recording An Automated TestRecording An Automated Test 1.1. Open OrangeHRM application in FirefoxOpen OrangeHRM application in Firefox http://hrm.portnov.comhttp://hrm.portnov.com (*1)(*1) 2.2. Open Selenium IDE in FirefoxOpen Selenium IDE in Firefox Go to ToolsGo to Tools  Selenium IDE (*2)Selenium IDE (*2) 2828 *2*1 The Record button is ON by default www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 29. Login TestLogin Test  Make sure Record button is ON!Make sure Record button is ON!  Go to the Browser windowGo to the Browser window  Login using (*2):Login using (*2): Login Name: adminLogin Name: admin Password: passwordPassword: password  Click Login buttonClick Login button 2929 *1 *2 The Record button is ON by default Login Name: admin Password: password Then click Login button www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 30. Login TestLogin Test  Highlight “Welcome Admin” text (*1)Highlight “Welcome Admin” text (*1)  Right-click and selectRight-click and select VerifyTextPresentVerifyTextPresent (*2)(*2)  Click logout linkClick logout link 3030 *1 *2 Highlight “Welcome demo” Select VerifyTextPresent www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 31. Stop RecordingStop Recording Go to Selenium IDEGo to Selenium IDE Click the red button to STOP recordingClick the red button to STOP recording All your actions are recorded and displayed sequentiallyAll your actions are recorded and displayed sequentially under Command Table Tabunder Command Table Tab 3131 Click here to Stop recording www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 32. What did we accomplish?What did we accomplish? Manual Test-Case Test-Case ObjectiveTest-Case Objective Ensure Valid User LoginEnsure Valid User Login StepsSteps  In the login textbox typeIn the login textbox type admin.admin.  In the password textbox typeIn the password textbox type password.password.  Click Submit buttonClick Submit button  Verify that a correct user nameVerify that a correct user name is displayedis displayed  LogoutLogout Expected ResultExpected Result 1)1) OrangeHRM index page isOrangeHRM index page is loadedloaded 2)2) Correct username is displayedCorrect username is displayed as part of the greeting.as part of the greeting. ““Welcome Admin”Welcome Admin” Automated Test-Case 3232 We created our first automated test scriptWe created our first automated test script www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 33. Running Selenium Automated TestRunning Selenium Automated Test Make sure the Firefox browser is still openMake sure the Firefox browser is still open Go to Selenium IDE and clickGo to Selenium IDE and click ““Play current test case”” buttonbutton 3333 *1 *2 Click to play the Test Case Make the test case playback in slow mode www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 34. Interpreting ColorsInterpreting Colors  If you see all the command line rows turnIf you see all the command line rows turn GreenGreen color,color, then the test has passed.then the test has passed.  Light Green means the code executed without problems.Light Green means the code executed without problems.  Dark GreenDark Green means the test result of the commandmeans the test result of the command evaluated toevaluated to truetrue..  If any part of the test failed it will be shown withIf any part of the test failed it will be shown with RedRed color.color. 3434www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 35. DebuggingDebugging Examine the result of the script.Examine the result of the script. 3535 Time is needed to validate the login information…Time is needed to validate the login information… The test mustThe test must WAITWAIT for the next web page to loadfor the next web page to load before proceeding.before proceeding. What went wrong? www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 36. Debugging TipsDebugging Tips  Open Selenium IDE through Tools menu,Open Selenium IDE through Tools menu, otherwise the IDE may freeze and actotherwise the IDE may freeze and act unpredictably.unpredictably.  Make sure you substitute click command withMake sure you substitute click command with clickAndWait command wherever needed.clickAndWait command wherever needed. 3636www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 37. EditingEditing EditingEditing to add wait timeto add wait time to the scriptto the script 1.1. Click the 3rd to last row whereClick the 3rd to last row where ClickAClickA command iscommand is locatedlocated 2.2. Modify the command fieldModify the command field  Replace “click” withReplace “click” with “clickAndWait”“clickAndWait” commandcommand 3.3. Re-play the test…Re-play the test… 3737 Click this row Select clickAndWait command www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info
  • 38. Helpful Notes:Helpful Notes:  One Firefox browser window must be open.One Firefox browser window must be open.  Multiple browser windows will confuse Selenium.Multiple browser windows will confuse Selenium.  Play back every automated test to ensure expectedPlay back every automated test to ensure expected behavior.behavior.  Keep playback inKeep playback in slowslow mode when debugging.mode when debugging.  Placing Browser window and Selenium IDE windowsPlacing Browser window and Selenium IDE windows side by side is a convenient way of tracking testside by side is a convenient way of tracking test execution step by step.execution step by step. 3838www.Seleniumonlinetraining.infowww.Seleniumonlinetraining.info