In
our project Your_Project_Name (ex- CustomerCentre) , we are using Hybrid Framework(why framework required) which is the combination of Data Driven, Method Driven and Modular Driven Framework. Basically
this involves 3 stages-
1) Designing the framework,
2) Implementing the framework,
3) Execution of the framework.
1) Designing the framework,
2) Implementing the framework,
3) Execution of the framework.
1) Designing the framework-
a) while designing
the fw in anyone of the local drive create a folder by name
HybridFramework. Launch the eclipse, set the workspace to
HybridFramework.
b)
in eclipse create a java project by name CustomerCentre.
c) in eclipse under CustomerCentre proj create a folder Jars & to that Jars folder include all the jar files related to the project such WebDriver jar, poi jar etc.
d) in eclipse under CustomerCentre proj create another folder by name Drivers to this folder copy all the executable files or driver such as Chrome Driver, IE driver and so on.
c) in eclipse under CustomerCentre proj create a folder Jars & to that Jars folder include all the jar files related to the project such WebDriver jar, poi jar etc.
d) in eclipse under CustomerCentre proj create another folder by name Drivers to this folder copy all the executable files or driver such as Chrome Driver, IE driver and so on.
When
designing the framework there are methods which can be used in more than one
project such methods we call it as Generic method. And there are
methods which are related to only one single project those methods
are called as project specific method.
Naming
convention for package- com.projectname.packagename
(com.CustomerCentre.Library)
All
the methods related to Generic, we write them under GenericLibrary
class which is present in the Libraries package. And all the project
specific methods are written under ProjectSpecificLibrary class which
is present under libraries package.
All
the GenericLibrary method should be public as well as static. Like –
getLastRowNum, getCellValue, setCellValue, etc.
In
the application there are certain types of steps which has to be used
again & again such as open browser, open application & so on.
In order to handle these types of steps we create ConfigLibrary
(SuperTestNG) class in which we have written the methods by using
Selenium annotations like @BeforeMethod, @AfterMethod etc. so that we
need not to write the code for repeating steps each time. Inharit
this class from all other classes to use these class methods.
We
create an excel file by name Config, in which we wrote all the input
data for the testing and then copy the entire excel file, and paste
it under the CustomerCentre project.
To
confirm everything working fine or not, we create a dummy package
with dummy @Test method. If browser is getting launched, app is
getting launched & browser is getting closed i.e. whatever we
have developed till is correct. Then delete the dummy package.
To
perform the validation, we create one more class Assertion. Whenever
we need to perform validation we need to call assertText() or
assertTitle() present under the Assertion class.
(Assert.assertEquals())
2)- Implementing the ProjectSpecificLibrary-
This is where actual implementation of the framework start. While going thru the manual testcases we note down the common repeated steps and make those steps as a project specific methods. Even if one step is repeating , may be in same testcase or other testcase make it as a method. Then write the test script for all the manual test cases.
3)- Execution-
Right click on the project, navigate to TestNG → convert to TestNG
→ give the proper suite name and test name and click on finish.
Then execute this xml file (ctrl+f11) or right click and run as
TestNG Suite. Or to run thru cmd → navigate till project then give
this commnd-
superb explanation... Thanks a lot.........
ReplyDeleteVery helpful.....thanks a lot....
ReplyDeletethanks a lot sanjay
ReplyDeleteVery good though to explain in a systematic approach. Big clap.
ReplyDeleteIt would be good if you could add the sample project under which you are explaining assertText() or assertTitle() etc. It will help deeper to understand the thought process.
ReplyDelete@Amit , please find the project here which is developed with POM framework which is better than hybrid framework.
ReplyDeletehttp://selenium-makeiteasy.blogspot.in/2014/06/page-object-model-pom-with.html
Hi Sanjay,
ReplyDeleteVery good explanation i struggled lot to explain the frame work in interview, every time (Since 3months) i failed. Hope this time i will crack the interview.
Hi Sanjay,
ReplyDeleteIn the above diagram can you please explain me about Module 1,2,3.xml and module test 1,2,3. What kind of test cases written in this module. I am bit confused how it is interrelated. How to explain this flow in interview according to diagram.
thanks a lot Sanjay....
ReplyDeleteHi Sanjay Kumar Soni Ji,Thanks a LOT for the wonderful explanation.Please keep up the Good Work.May GOD BLESS YOU...
ReplyDeleteHi sanjay very good explanation , i failed 2 times to explain in interview, this time i can make it .Thnx a lot, better make video of it ,s o that it will be more useful
ReplyDeleteHello Mukund, there is no 4rth step i mentioned.
ReplyDeleteExecution means to run the script. After executing the script you will get the execution report with passed and failed test cases. That's all.
Thanks . And one more thing if in config file has the steps which is going to get repeated what would be in project specific libraries. Because i taught that URL and other login details would be in project specific? So it would be good if you can give me the example in project and config lib
ReplyDeletePlease have a look here in the code and framework structure (It is also a kind of hybrid framework)- http://selenium-makeiteasy.blogspot.in/2014/06/page-object-model-pom-with.html
ReplyDeleteI want to become a automation tester please suggest me recently I am working as a manual tester last 1 year please suggest me entry level study so that I can explore my skills day by day
ReplyDeletethanks
nitin
Sir ,Can you please explain module1.xml,module2.xml,module.xml, what is the purpose of that,they are object repository?
ReplyDeletesoooper amma. keep up the good work. Your support is appreciated
ReplyDeleteSuperb Sanjay...Keep the good work going...
ReplyDeleteThx a lot Sanjay... very clear cut points and easy to understand...
ReplyDeleteExcellent bro...........
ReplyDeletenice
ReplyDelete