Sunday 25 June 2017

Advanced Xpath:

Advanced Xpath Notes:
click on this link to download basic notes on advanced xpath.
 
Task Url: http://testingmasters.weebly.com/webtables.html


Tasks:

Write the selenium code for the below tasks using the advanced xpath concepts and url above.
1)      Print the employee ID's of the candiates whose designation is Analyst.
2)      Print the Mail Id's of the candidates who have applied for less than or equal to 5 days.
3)      Click on the checkboxes of the records whose Designation is Manager.
4)      Click on the checkboxes of the records whose applied days are more than 8 days.
5)      Reject the leaves applied by Analyst.
6)      Print the employee Id's of the approved candidates.
7)      Click on the checkboxes of the records whose username is Vinod and Designation is analyst.
8)      Click on checkboxes of first five records.
9)      Clik on checkboxes of last 4 records.
10)  Click on checkboxes whose email id starts with 'demo'.

Thursday 22 June 2017

Steps to Automate TestCase in TestingMasters Framework:

Steps to download and setup Testing Masters Framework:

The following are the steps to download and setup testing masters framework
1)      Click on this link to download framework.
2)      UnZip the downloaded project.
3)      The testscripts can be executed in two ways mainly
a.       From trigger.bat file – Windows Explorer
b.      From testng.xml file – eclipse editor
Case a):
o   open the project location in the windows explorer.
o   And double click on trigger.bat file.
o   the execution will get started and results will be generated.
Case b):
o   Open eclipse, import framework to workspace.
[File>>Import>>ExistingProjectToWprkspace>>SelectProject>Finish]
o   Right click on testng.xml file
o   Select RunAs>>TestNG Suite.
4)      View current execution status in the results folder along with date and time stamp.

Components Overview Documentaion:

Click on this link for navigating to components overview documentation.

Manual TestCases:

Click on this link to download the testcases to be practised for automation.

Steps to follow while preparing a testscript in framework:

1)      Go through the manual testcase.
2)      Check if the functionality and the testdata are provided correctly in the testcase.
3)      Check the functionality/the flow of testcase once manually.
4)      If any queries or the preconditions missing, then we have to interact with the manual team and get them clarified and documented.
5)      Import the project to current workspace
6)      The following are the components that are to be updated mainly.
a)      Update Object Repository
b)      Update TestScript Definitions
c)      Execute Individual TestCase.
d)      Update Run Manager.
e)      Final Execution
Step a):Update Object Repository:
o   Create a class for the new webpage to be added in the application.
o   Add every interacting  webelements to the class.
o   Use below naming convention while updating the object repository
                                                                                i.            TextField --> Edt_
                                                                              ii.            Button      --> Btn_
                                                                            iii.            Checkbox -->Cb_
                                                                            iv.            SelectBox -->Lst_
                                                                              v.            RadioButton-->RbBtn_
                                                                            vi.            Message       -->Msg_
o   Create static set methods if the properties has to be set dynamically for the webelements in the webpage.
Step b)UpdateTestScriptDefinitions:
o   Make a copy of the SampleTestScript.java file inside the desired module package.
o   Rename the SampleTestScript.java  file based on the testcase going to be automated.
Example: TC201_AddQualificationDetails_WorkExperience
o   Go through the existing weblibrary methods from GenericResources.xlsx
o   Now start writing the testscript in the using the webibrary methods.
o   If any reusable code is identified, update them in the userlibrary file.
      Step c)Execute Individual TestCase:
o   Execute individual testscript to verify the script status.
                                                                        i.            Right click on selected TestCase
                                                                      ii.            Select RunAs>>TestNG Test.
o   If the script is failed, analyse and fix thge issues by debugging process.
                                                                        i.            Place BreakPoint on the desired step.
                                                                      ii.            Right click on selected TestCase
                                                                    iii.            Select DebugAs>>TestNG Test.
       Step d)Update RunManager:
o   Update ExecutionController Sheet with the testcase information.
                                                                        i.            ModuleName
                                                                      ii.            TestCaseName
                                                                    iii.            TestCaseDescription
                                                                    iv.            ExecutionStatus{ whether to execute testcase or not}
                                                                      v.            Priority {Impacted TestCases should be given first priority}
o   Update TestData Sheet with the Testdata of the testcase.
                                                                        i.            ModuleName
                                                                      ii.            TestCaseName
                                                                    iii.            Update Cell According to the testdata required for execution
o   Fill the testdata in the form of  FieldName:=FieldValue
o   Update CommonTestData Sheet
                                                                        i.            Update the testdata which is common accross al the testcases.
                                                                      ii.            Select the option to record the screen while execution.
                                                                    iii.            Select the option to highlight webelements while execution.
                                                                    iv.            Selct option to take screenshot while execution.
       Step e)Final Execution:
o   Select execution as true for  the testscripts that are to be executed in the current run.
Execution Case1:
                                                                        i.            Open eclipse, import framework to workspace.
                                                                      ii.            Right click on testng.xml file
                                                                    iii.            Select RunAs>>TestNG Suite.
Execution Case2:
                                                                        i.            open the project location in the windows explorer.
                                                                      ii.            And double click on trigger.bat file.
                                                                    iii.            the execution will get started and results will be generated.
o   After Execution check the final status in the results\LAstRun folder



Monday 19 June 2017

Components of Testing Masters 5.0 Selenium Framework

Components Of Testing Masters Framework:

The following are the components of the TestingMasters selenium hybrid driven framework.
1.      FrameworkLibrary -- Framework Specific
a)      Excel Library
b)      WebLibrary
2.      ObjectRepository -- Project Specific
a)      Pg_Login
b)      Pg_Home
c)      Pg_EmgergencyContacts etc…
3.      TestScript Definitions -- Project Specific
a)      TC101_AddEmergencyContactsAndVerify
b)      TC102_AddDependenciesAndVerify etc..
4.      UserLibrary -- Project Specific
5.      RunManager -- Project Specific
a)      Execution Controller
b)      TestData
6.      Jar Files-- Framework Specific
7.      BrowserServers-- Framework Specific
8.      Results-- Project Specific[Auto Generated]
9.      testng.xml -- Framework Specific
10.  Trigger.bat file  -- Framework Specific




1.FrameworkLibrary:

o   This contains the reusable methods for working with excel sheets,Report generation, working with Web Pages etc.
o   This is generally a framework specific folder.
o   The methods or classes in this folder can be used while writing testcase definitions.
o   These are specified in frameworklibrary package.

            Excel Library:

o   In this library all the methods that re required for the interactions with the excel sheets are specified.
o   These methods can be used while developing a testcase for reading and writing the data to excel.
o   The following are the sample methods in WebLibrary
1)      getdata
2)      putdata
o   The methods in this library are generic,framework specific and can be useful in writing  the testcases.

WebLibrary:

o   In this library all the methods that re required for the interactions with the webpage are specified.
o   These methods can be used while developing a testcase for performing operations on the webelements.
o   The following are the sample methods in WebLibrary
1)      setText
2)      clickElement
3)      Exist
o   The methods in this library are generic,framework specific and can be useful in writing the testcase.

2.ObjectRepository:

o   This contains all the element descriptions in the page wise.
o   A class is created for every page and each webelement  is described as variables.
o   This is generally a Project specific folder.

3.TestCase Definitions:

o   In this, we will define the actual testscripts code.
o   We will create a method for every testcase,inside TestScriptDefinitionspackage.
o   The testcase name should be same in RunManager,TestData Sheeet,className in TestingMasters.OrangeHRM.Module package.
o   While writing the testcases, we will use the necessary methods which are already defined in weblibrary and userlibrary classes.
o   This is a project specific folder

4.UserLibrary:

o   In this library, the Test Engineer can add methods for the reusable steps across the testcases.
o   Before/After writing the testcases, TestEngineer will check for the reusability components in the testcase.
o   Will check if the method is already existing for this functionality.
o   If existing, TestEngineer can use that method in the testcase.
o   Else,TE can add a method to the user library.
o   The methods in this library are generic,framework specific and can be useful in writing the testcase.

 

5.Run Manager:

o   In RunManager, we have two sheets
a)      Execution Controller
b)      TestData

               5.a)Execution Controller:

o   This is an excel file in which all the testcase information is stored along with execution flag
o   The following is the template of the Run Manager file
o  
o   Here the testengineer can select the testcases that are to be executed in the current Run.
o   For the testscript development, the first task will be to mention the testcase in the     runmanager.xls file.
o   This is a project specific file

             5.b)Test Data:

o   In this folder we have to specify the testdata that is required for the execution of the testcase
o   The TestData is stored against the testcasenames in these files
o   The following is the template of specifying the testdata
o  
o   The Testdata is stored in the format of FieldName:=TestData for that field
Example:
                                                        i.            UserName:=user02
                                                      ii.            Name:=Srinivas
      o   This is a Project specific file.

6.JarFiles:

o   In This Folder all the required jar files for the framework are placed.
o   These jar fields includes POI,Selenium,Extent Report files.
o   For setting a project, first we need to add these jar files to the project in the eclipse.
o   This is framework specific component.

7.BrowserServers:

o   In this folder all the browser servers required for execution of multiple browsers are placed.
o   This mainly contains Chrome,IE Driver servers.
o    This is framework specific component.

8.Results:

o   In this folder, results will be generated for every run.
o   For every run,a folder is created with a date and time stamp.
o   Inside the folder the respective screenshots and results summary.html is stored.
o   This will be a project specific folder

9.Testng.xml:

o   This file is used to trigger the executions of the testcases from eclipse.
o   In this the references of the listner classes,libraries and testscript definitions are provided.
o   This is framework specific file

10.Trigger.bat:

o   This file is used to trigger the executions of the testcases from windows explorer.
o   Trigger.bat file will inturn invokes the testng.xml
o   testng.xml will Takecare of the furthur executions.
o   This is framework specific file

Testing Masters Framework  Download Link:

 This click on this link to download the testing masters V5.0 selenium framework.

Testing Masters Framework Overview Video: