selenium training.pptx

Upload: sreenivasulureddych

Post on 30-Oct-2015

41 views

Category:

Documents


0 download

DESCRIPTION

Selenium Training

TRANSCRIPT

PowerPoint Presentation

Selenium - TrainingTool for Functional Testing for Web Applications

PresenterSaranya. BS([email protected])

1AgendaIntroduction to Selenium Different Components of SeleniumChoosing the right Selenium tool Selenium IDE InstallationRecord and Play back using Selenium IDE toolSelenium RC InstallationTestNG framework setupRunning Test suites in TestNG frameworkReport generation using TestNG

Introduction to Selenium

Selenium is an open source toolIt is used for testing Web based applicationsIt can run in most of the Browsers and Operating systemsHighly flexible and user friendly toolTest scripts can be written in many programming languages (C,C++, Java, Python,.Net, etc.,)Different Components of SeleniumSelenium IDEA simple Firefox plugin to record and playback testsIt doesnt require programming knowledgeSelenium RC (Remote Control)Used to run tests in different browsersSelenium RC is a combination of selenium server and any of the client libraries (E.g., Java, .Net, C,C++, etc)Selenium GridSelenium Grid is used to run tests in parallelThe tests that are run in parallel can be executed in multiple browsers running in multiple systems running different OSes.Choosing the right Selenium toolIDE can be used for simple record and playback of test scripts, where the code doesnt need huge customizationsIt does support customization of code like add/edit/remove but not loopsThis can be used even without any knowledge of programming languagesSelenium IDESelenium RC/ GridThis can be used for creating advanced, modularized test scripts(eg., for Data driven test, for including loops, for customized test runs)Needs knowledge on programming languages like Java, .Net, C, C++, etc.

5Selenium IDE InstallationSelenium IDE plugin can be downloaded from the below site http://seleniumhq.org/download/Open Firefox and drag and drop the downloaded file into the browserInstall the plugin and restart the browserThe selenium IDE tool can be seen under the Tools menu in Firefox

Selenium IDE ComponentsMenu BarCan Create/Open Test cases and Test suitesTest Cases could be exported to any language of our choice from menu barTool BarPlay Test cases/ Test suiteControl the speed of playing Test casesPause and Replay the current running test caseLog/Reference/UI-Element/RollUpThe error messages and the information messages could be seen under log at the bottom paneSelenese Selenium commandsEg., click, click and wait,Verifyelement Present, Vertifytextpresent

Record and Playback using SeleniumInitialize selenium from the tools menu in FirefoxEnter the URL of the application you want to test in FirefoxDo the test case manually using mouse and keyboardAll the actions performed will be recorded by selenium pluginOnce the test case is complete, stop the recording from selenium toolbar and save it as a test case by giving it a unique name.we can run these recorded test cases later during regression analysis in every intermediate releases.Building Test CasesRecording Actions on the website will get added automatically as commands Adding Check points We can add assertions/verification points to check the propertiesEditing We can add/edit/delete commands from the Source View or Table ViewSelenium RC ComponentsSelenium RC (Remote Control) is a combination of Selenium Server along with Client LibrariesThe Client Libraries could be any one of the followingJava.NetPythonRubySelenium RC Architecture

Selenium RC Installation with Java ClientSelenium ServerDownload Selenium server file(selenium-server-standalone-.jar)Java Client LibraryDownload the Java Client driver Zip and extract the same in a locationBoth the files could be downloaded from the following location http://seleniumhq.org/download/Configure the Library files into the Java IDE(Eclipse, NetBeans,etc.,)

Frameworks Used in SeleniumSelenium RC with Java client libraries are used in majority with following two Frameworks.JUnit FrameworkTestNG FrameworkTestNG has the following advantages over JUnitSupport for AnnotationsLog ReportParameterisation

TestNG Framework SetUpTestNG is a java plug-in for EclipseTestNG could be downloaded from Eclipse by going to Help > Install New SoftwareType the following URL against Work with option http://beust.com/eclipse and continue with installationOnce installation gets completed, the same can be seen under Windows Menu >> Show View >> Others >> Java >> TestNG(Shortcut: Alt+Shift+Q Q)Running Test Suites in TestNG FrameworkCreate a Java ProjectCreate an annotation class and write the test suite for testing the websiteInclude all the external jar files to connect to the selenium serverRight click on the project and run the test as TestNGReport Generation using TestNGAll the reports will be present in test-output folderAn Email-able report will be availableWe can get the number of methods/suites passed or failedThe time taken for running each tests could also be found the in the log report?QuestionsThank You All !!!