Difference between Java, Selenium and Frameworks



What is Java :

Java is platform which is use to take a control or develop any applications like windows browsers.
We if want to take a control of any application we need to implement script in java.

For example to store a huge amount of data in variable they have implemented Collection API( ArrayList,Map etc), to develop window applications we have AWT or Swings or Hibernates APIs(packages).

What is selenium :

In the same way if we want to take control of Browsers to do basic activities like launch browser ,open url, click ,type etc. we need some script. This we get in the for of API. Generally this API we can call as Selenium. So selenium is not a tool. It is a set of java scripts.

Frameworks :

Once getting selenium we need to implement script according to our requirement, Generally we set a common format to implement in order to understand by everyone for future updates.Format we can call as frameworks.

We have different frameworks like TestNg, Keyword driven, Hybrid(own) .
Every framework has its own way of flow of script execution and results presentation.

TestNg Framework : It has few annotations like BeforeSuite, AfterSuite, BeforeClass, AfterClass,Test etc preceding with @. and once we execute script we get results in html view which we can see in test-output folder.

If we want to handle with multiple classes then we go with suite.xml file. here we can pres pare different scenarios like

Authentication:
      Login,Signup

Transactions:
      Login, balance check, logout

Re-testing:
      Signup

Regression Testing:
      Login, balancecheck, logout

if we want to execute all above scenarios we will execute suite.xml file. other again if we want to execute few of the scenarios then go with ant(we will discuss it later, it is a build management tool).

Keyword Driven Framework.

It is similar to the testing framework , but here annotations,no predefined results format.

Here flow of script execution from can be handled from excel sheets in the form of by giving run mode "yes" or "no".