Set Up - Java and WebDriver with Eclipse

https://www.mkyong.com/maven/how-to-install-maven-in-windows/


1. Download and Install Java Development Kit (JDK) on Windows
    http://toolsqa.com/selenium-webdriver/download-and-install-java/

2. Download and Start Eclipse IDE
    http://toolsqa.com/selenium-webdriver/download-and-start-eclipse/

3. Download Selenium WebDriver Java client (library files)
    http://toolsqa.com/selenium-webdriver/download-selenium-webdriver-java-client/

4. Configure Eclipse with Selenium WebDriver
    http://toolsqa.com/selenium-webdriver/configure-eclipse-with-selenium-webdriver/

5. Download Chrome driver –
    http://toolsqa.com/selenium-webdriver/running-tests-in-chrome-browser/

6. How to install Maven on Windows and Set the path of the GeckoDriver in Environment Variables

GeckoDriver
***********
a. Go to My Computer and Right click to get the context menu.
b. Click on the Change Settings on the opened window.
c. Go to Advance tab in the System Properties window and click on Environment Variables.
d. Now under the System variables, select Path and click on Edit.
e. At the end of the string use semicolon and paste the path of the GeckoDriver.

Apache Maven
************
1. JDK and JAVA_HOME
Make sure JDK is installed, and “JAVA_HOME” variable is added under System variables "Environment Variable". And paste the path of JDK.
2. Download Apache Maven
Unzip to downloaded folder – C:\Program Files\Apache\maven

3. Add M2_HOME and MAVEN_HOME
Add both M2_HOME and MAVEN_HOME variables in the Windows environment and paste the path of Maven folder.

4. Add To PATH
Update PATH variable, append Maven bin folder – %M2_HOME%\bin, so that you can run the Maven’s command everywhere.

5. Verification

Done, to verify it, run mvn –version in the command prompt.

Basics of Java for Selenium

JAVA

1.       Class is a template or blueprint from which objects are created.
2.       Object  is an instance of a class.
3.       Method is a collection of statements that are grouped together to perform an operation.
4.       Constructor - Constructor is a special type of method that is used to initialize the object.
5.       Modifiers - There are two types of modifiers access modifiers and non-access modifiers.
6.       Inheritance is a mechanism in which one object acquires all the properties and behaviors of parent object.
7.       Polymorphism is a concept by which we can perform a single action by different ways.
8.       Encapsulation is a process of wrapping code & data together into a single unit eg. capsule.
9.       Exception Handling handling is a mechanism to handle the runtime errors so that normal flow of the application can be maintained.


1. Class
It is a template or blueprint from which objects are created. A class can contain:
·         Fields or Instance Variable
·         methods
·         constructors

 Object
Object is an instance (result) of a class.

2. Instance variable
A variable which is created inside the class but outside the method.

3. Method
Method is a collection of statements that are grouped together to perform an operation.
eg. When you call the System.out.println() method, the system actually executes several statements in order to display a message on the console.

4. Constructor
Constructor is a special type of method that is used to initialize the object.

i. Difference between a constructor and a method:
a. A constructor doesn’t have a return type.
b. The name of the constructor must be the same as the name of the class.
c. A constructor is called automatically when a new instance of an object is created.
d. Constructors are called only once for a single object while regular methods could be called many times .

ii. Types of Constructor:
a. Default constructor (no-arg constructor)
b. Parameterized constructor

a.       Default Constructor - Default constructor provides the default values to the object like 0, null etc.

class Bike1{ 
Bike1()//default constructor
{
System.out.println("Bike is created");
                            //---------------------------------------------------------------------
public static void main(String args[]){ 
Bike1 b=new Bike1();  //Default constructor invoked
}

b.      Parameterized constructor - A constructor that have parameters is known as parameterized constructor.

class Student4{ 
int id;  //field or data member or instance variable
String name; 

Student4(inti,String n){          //Constructor having 2 parameters
id = i; 
name = n; 
    } 
void display(){System.out.println(id+" "+name);} 
                     //---------------------------------------------------------------------
public static void main(String args[]){ 
    Student4 s1 = new Student4(111,"Karan"); 
    Student4 s2 = new Student4(222,"Aryan");  //Parameterized constructor invoked
s1.display(); 
s2.display(); 
   } 

iii. Constructor Overloading
Constructor overloading is a technique in which a class can have any number of constructors that differ in parameter lists.

class Student5{ 
int id; 
String name; 
int age; 
Student5(inti,String n){ 
id = i; 
name = n; 
    } 
Student5(inti,Stringn,int a)    //constructor overloaded
id = i; 
name = n; 
age=a; 
    } 
void display(){System.out.println(id+" "+name+" "+age);} 
               //---------------------------------------------------------------------
public static void main(String args[]){ 
    Student5 s1 = new Student5(111,"Karan"); 
    Student5 s2 = new Student5(222,"Aryan",25); 
s1.display(); 
s2.display(); 
   } 
}

5. Modifiers
There are two types of modifiers access modifiers and non-access modifiers.

i. Access modifiers - specifies the scope of "instance variable", method, constructor or class.

a.       private - private access modifier is accessible only within class. If you make any class constructor private, you cannot create the instance of that class from outside the class.

b.      default - If you don't use any modifier, it is treated as default bydefault. The default modifier is accessible only within package.

c.       protected - The protected access modifier is accessible within package and outside the package but through inheritance only.

d.      public - The public access modifier is accessible everywhere.

ii. Non-access modifiers - such as static, abstract, synchronized, native, volatile, transient etc.

a.       Static - static is used for memory management. The variable or Method that belong to the Class rather than to any particular instance.

6. public static intmethodName(int a, int b) {
}
·         public static − modifier
·         int − return type
·         methodName − name of the method
·         a, b − formal parameters
·         int a, int b − list of parameters

7. The this keyword
This keyword  is used as a reference to the object of the current class.

8. super keyword in java
super keyword is is used as a reference to the object of immediate parent class.

9. Inheritance
Inheritance  is a mechanism in which one object acquires all the properties and behaviors of parent object.
·         For Method Overriding (so runtime polymorphism can be achieved).
·         For Code Reusability.

Syntax of Inheritance
class Subclass-name extends Superclass-name 
   //methods and fields 
}

The extends keyword indicates that you are making a new class that derives from an existing class. The meaning of "extends" is to increase the functionality.

10. Polymorphism
Polymorphism is a concept by which we can perform a single action by different ways.  Polymorphism means many forms. There are two types of polymorphism:
·         compile time polymorphism (Method overloading)
·         runtime polymorphism (Method overriding)

We can perform polymorphism by method overloading and method overriding.

                    i.            Method Overloading
If a class has multiple methods having same name but different in parameters, it is known as Method Overloading. Method overloading increases the readability of the program.

There are two ways to overload the method in java
·         By changing number of arguments
·         By changing the data type

                  ii.             Method Overriding
If subclass (child class) has the same method as declared in the parent class, it is known as method overriding in java.

Usage of Java Method Overriding
·         Method overriding is used to provide specific implementation of a method that is already provided by its super class.
·         Method overriding is used for runtime polymorphism

Rules for Java Method Overriding
·         method must have same name as in the parent class
·         method must have same parameter as in the parent class.
·         must be IS-A relationship (inheritance).


iii. Final
The final keyword in java is used to restrict the user. Final can be:
1.       variable - If you make any variable as final, you cannot change the value of final variable(It will be constant).
2.       method - If you make any method as final, you cannot override it.
3.       class - If you make any class as final, you cannot extend it.

Can we declare a constructor final?
No, because constructor is never inherited.

11. Abstraction is a process of hiding the implementation details.
It shows only important things to the user and hides the internal details for example sending sms, you just type the text and send the message. You don't know the internal processing about the message delivery.

There are two ways to achieve abstraction in java
·         Abstract class (0 to 100%)
·         Interface (100%)

        i.            Abstract class
A class that is declared with abstract  keyword is known as abstract class. It needs to be extended and its method implemented. It cannot be instantiated.
Example - abstract class A{}

Abstract method
A method that is declared with abstract keyword and does not have implementation is known as abstract method.
Example - abstract void printStatus();//no body and abstract (declaring signature)

      ii.            Interface
An interface is a blueprint of a class. It has static constants and abstract methods. There are mainly three reasons to use interface.
·         It is used to achieve abstraction.
·         By interface, we can support the functionality of multiple inheritance.

iii. Difference between abstract class and interface
1) Abstract class can have abstract and non-abstract methods.
Interface can have only abstract methods.

2) Abstract class doesn't support multiple inheritance.
Interface supports multiple inheritance.

3) Abstract class can have final, non-final, static and non-static variables.
Interface has only static and final variables.

4) Abstract class can provide the implementation of interface.
Interface can't provide the implementation of abstract class.

5) The abstract keyword is used to declare abstract class.
The interface keyword is used to declare interface.

6) Example:
public abstract class Shape{
public abstract void draw();
}

Example:
public interface Drawable{
void draw();
}

Simply, abstract class achieves partial abstraction (0 to 100%) whereas interface achieves fully abstraction (100%).

12. Encapsulation
Encapsulation is a process of wrapping code and data together into a single unit, for example capsule i.e. mixed of several medicines.
We can create a fully encapsulated class in java by making all the data members of the class private. We can use setter and getter methods to set and get the data in it.

get and set methods
They serve to set and get values from class variables that are defined as 'private' (because of security issue), but these method are defined as 'public'.

13. Exception Handling
The exception handling is a mechanism to handle the runtime errors so that normal flow of the application can be maintained.
The advantage of exception handling is to maintain the normal flow of the application.

Suppose there is 10 statements in your program and there occurs an exception at statement 5, rest of the code will not be executed i.e. statement 6 to 10 will not run. If we perform exception handling, rest of the statement will be executed. That is why we use exception handling in java.

Types of Exception
i. Checked Exception - Checked exceptions are checked at compile-time. Checked Exception uses "throws" keyword.
e.g. IOException, SQLException

ii. Unchecked Exception - Unchecked exceptions checked at runtime.
ArithmeticException
NullPointerException
NumberFormatException

There are 5 keywords used in java exception handling.
·         try
·         catch
·         finally
·         throw
·         throws

Java try-catch
Java try block is used to enclose the code that might throw an exception.


Testing is a process to find bugs, find them as early as possible, and make sure they get fixed.

Testing Types 

1. White box testing (Also known as Clear Box Testing, Glass Box Testing, Open Box Testing and Structural Testing): Used to test internal based application.
 
2. Black box testing (Also known as Skin Box Testing, Closed Box Testing and Behavioral Testing): Used to test functional based or requirement based application.
 
3. Gray box testing: Used to test web applications. It is a combination of both White box & Black box testing.

Testing Techniques (Testing approach)


The most popular Black box testing techniques are:
1. Equivalence Partitioning
2. Boundary Value Analysis
3. Cause-Effect Graphing
4. Error-Guessing

The White-Box testing techniques are:
1. Statement coverage
2. Decision coverage
3. Condition coverage
4. Decision-condition coverage
5. Multiple condition coverage
6. Basis Path Testing
7. Loop testing
8. Data flow testing

Software Testing Check List
Sometimes testers get confused when they have assigned testing task. They don't know from where they should start the testing. To keep this in mind, I have compiled information from many channels. I have created a Checklist for website testing as well as Checklist for Desktop application Testing

Checklist covers the following points:
Step 1 - User Interface Testing (GUI Testing)
Step 2 - Functional Testing
Step 3 - Interface Testing
Step 4 - Compatibility Testing
Step 5 - Security Testing
Step 6 - Performance testing











Responsibilities of a Tester
a. Understand project requirements.
b. Develops and implements Test Plans that will address the testing needs of functional, regression, integration and system testing.
c. Update Test Case document.
d. Conduct Testing including Smoke, Sanity, and Execute the Test cases.
e. Update the Test Result document.
f. Attend the Regular client calls.
g. Log / File the defects in Defect tracking tool / Bug Report.
h. Verify defects.
i. Discuss doubts/queries with Development Team / Client.
j. Implements software quality assurance standards and processes.
k. Participates in design reviews/walkthroughs for projects.
l. Other duties that are within education and experience or the incumbent may be assigned for the betterment of the company.



Related Testing Topics

a. Agile Testing
b. Black Box testing
c. Testing for Biginners
d. Smartphone Testing

Software Testing Travel domain

Sr. TERM DEFINITION
1 CRS and GDS
Computer Reservations System (CRS) is a computerized system used to store and retrieve information and conduct transactions related to travel (e.g Booking ticket from airindia.com).
CRS operations that book and sell tickets for multiple airlines are known as Global Distribution Systems (GDS - Only agents uses these systems).
The following is a partial list of Global Distribution Systems:
• 1A Amadeus
• 1S Sabre (previously 1W)
• 1G Galileo
• 1P Worldspan
2 Cabin A compartment where passenger seats are installed. More than one RBD may be assigned to a cabin for sale.  Often the terms "cabin" class and "compartment" are used interchangeably.
3 Class Section of seats on any particular flight (Economy, Business etc).
4 RBD Reservations Booking Designator: The code used in reservations transactions to identify a compartment on an aircraft and/or a special inventory control. The RBDs are typically represented by alphabetic characters (A, Z etc).
5 ARS Airline Reservation System is a computerized system containing information about schedules, availability, fares and related services, and through which airline inventory is maintained, reservations can be made and/or tickets issued.  Typically, only airline offices (ATO, CTO, CRC, etc) or their General Sales Agents (GSAs) utilize the ARS.
6 ADL Additions and Deletions List. List of passengers and related data sent from a Reservations system to a Departure Control system for a flight/date, subsequent to the PNL.
7 DCS Departure Control System: An automated method of performing check-in, capacity and load control and dispatch of flights. Generally, these type of systems are owned and/or operated by an airline or system provider.
8 PFS Passenger Final Sales. List of passengers and related data sent at flight close out from a Departure Control system to a Reservations system, containing deviations from the PNL/ADL for this station. 
9 PIL The PIL is a teletype message geneerated by the DCS for the local cabin crew to advise special information about passengers on board. 
10 PNR Passenger Name Record: A record of each passenger’s travel requirements which contains all information necessary to enable reservations to be processed and controlled by the booking and participating airlines. The basic record may contain one or more passengers.  Although different systems provide varying facilities, all PNRs contain at least passenger name(s), itinerary, and contact information.  May other fields may be present such as fare, ticketing, seat selection, etc.
11 PNL Passenger Name List. List of passengers and related data sent from a Reservations system to a Departure Control system for a flight date.
12 Record Locator A record locator is an alphanumeric code, typically 6 characters in length, used in airline reservation systems to access a specific record. When a passenger, travel agent or airline employee refers to a record locator they typically mean a pointer to a specific reservation which is known as a Passenger Name Record or PNR.
13 Code Sharing A code share flight is a flight that is marketed by one carrier and operated by another.
The airline that actually operates the flight is called the Operating Carrier. The company or companies that sell tickets for that flight but do not actually operate it are called Marketing Carriers.
14 Interline Interline partnerships allow two or more airlines to issue tickets on behalf of each other, while retaining the designator code of the other airline.
15 City Pair Combination of two city and/or airport codes representing the origin and destination of a flight leg, segment or routing.
16 Round Trip Equivalent to the term “Return Journey”, is defined as (a) travel from one point to another and return by the same air route used outbound whether or not the fares outbound and inbound be the same, or (b) travel from one point to another and return by an air route different from that used outbound for which the same normal, through, one way fare is established.
17 Circle trip When the traveler starts from one location, goes to multiple locations and come back at same location where he started e.g. JFK->LON->DEL->JFK 
18 One Way When the traveler just goes from Origin to Destination e.g. JFK->LON 
19 Round the world The journey in which the traveler travels around the world and crosses the international timeline, visiting multiple places e.g. JFK->SYD->HKG->DEL->LON->JFK
20 Open Jaw When the traveler goes from one place to another by air, from there, goes to a third place by other means of travel, and then takes a flight back to where he started e.g., he goes from JFK to LAX by air, from LAX to SFO by car, and then from SFO to JFK by air. 
21 Stopover Equivalent to a "break of journey", means a deliberate interruption of a journey by the passenger agreed to in advance by the airline, at a point between the place of departure and the place of destination. 
22 Flight Leg One take-off and one landing of a plane is called a flight leg with an associated flight number e.g. DEL-BOM IC123
23 Flight Segment  Passenger booking on one flight number which may include one or more flight legs e.g. if passenger goes IC123 DEL-BOM-TRV, then flight segment is IC123 DEL-TRV
24 Direct flights A flight that has a stop but no change in plane or flight number
25 Change of Gauge A flight with a stop and a change in plane, but the flight number is the same
26 Nonstop Flights A flight that has no stops and there is no change in plane or flight number
27 Connect Point An airport available as a connection location for a multi-leg itinerary
28 Married Segments Married segments is a term used to identify two or more segments in an itinerary which are actioned as a single unit (set).  Acceptance and sending of marriage information is controlled by bilateral agreements.
29 Ad Hoc Schedule A variation, addition or cancellation from the basic schedule of one or more flights on single dates.
30 Airline Designators IATA airline designators are two or three character codes assigned by the International Air Transport Association (IATA).  Designators are used to identify an airline for all commercial purposes, including reservations, timetables, tickets, tariffs, air waybills and in airline interline telecommunications.
31 Airport Terminal All buildings used for arrival and departure handling of aircraft.
32 ARNK Arrival unknown.  Used in reservations to fill a gap in the itinerary.   
33 Cabin Baggage Baggage of which the passenger retains custody (also known as hand or unchecked).
34 Cargo Any goods carried on an aircraft and covered by an air waybill.
35 Check-in The check-in process involves those activities necessary to evaluate passengers and make them ready to board flights. Check-in can be performed by humans or by machines (self-service devices such as kiosks).
36 Child A person who has reached his/her second birthday but not his/her 12th birthday as of the date of commencement of travel.
37 Infant A person who has not reached his/her second birthday as of the date of commencement of travel.
38 Expedite Baggage Passenger baggage that is not traveling with the passenger due to mishandling and is being forwarded to the passenger.
39 FOID Form of identification. Typically used to identify that the passenger is who he says he is.  This information may be passed in the reservation as an SSR and subsequently passed to a PNL/ADL to Departure Control in a .R/ element.  
40 FTL Frequent Traveler List. The FTL is a teletype message generated by the DCS to advise selected applications of all locally boarded passengers who checked-in with a frequent traveller account number. 
41 GMT Greenwich Mean Time.
42 IATA The International Air Transport Associationis an international industry trade group of airlines headquartered in Montreal, Quebec, Canada.  All the Airline rules and regulations are defined by IATA.
a. IATA publishes standards for use in the airline industry.
b. IATA maintains the Timatic database containing cross border passenger documentation requirements.
c. IATA coordinates the Scheduling process which governs the allocation and exchange of slots at congested airports worldwide.
43 International Flight Leg A flight leg between two stations to which different ISO country codes apply.
44 ISO International Organisation for Standardisation.  This organization assigns and maintains such information as country codes. 
45 Itinerary The part of the PNR describing the flight segments booked for the passengers named in the name field of the PNR.
46 Leg The operation between a departure station and the next arrival station.
47 Non-Stop Flight which operates between a board point and an off point in a single leg without any intermediate landings.
48 NOREC No record. A passenger who was boarded on a flight and was ticketed for that flight, but was not on the PNL/ADL.
The No Rec (No Record) processing page is used to create a new passenger record for passengers who have a paper ticket but no actual reservation on the flight being checked-in.
49 GOSHO Go show. A departed passenger that is not shown on a PNL/ADL and does not have an OK ticket.
The Go Show processing page is designed to accommodate passengers who have booked and paid a travel agent for their journey on the flight being checked-in, but no paper ticket has been issued/electronically recorded.  It is designed only to be applicable to agents/airlines using manual paper tickets.
50 NOSHO No show.  A passenger who had a reservation on a flight and is shown on the PNL/ADL but who failed to use the reservation for reasons other than misconnect.
51 OPEN A term used to specify in a PNR and on a ticket that specific flight is not booked but that the passenger will travel by air and has paid for a flight.
52 Open Ended Schedule A schedule submitted for processing without an end date. It is assumed that the schedule will be active indefinitely.
53 PTC Passenger Type Code is a code typically used to identify the type of passenger, e.g., adult, infant, etc. PTC is often used to identify the type of fare.
54 SSR Special Service Requirement (SSR). PNR record and/or message element which allows an agent to request a special service, designate a condition or provide mandatory information. Examples include special meals, identification of deaf passenger, wheelchair assistance, seat requests and government required information (APIS). 
55 Waitlist When used with PNRs, refers to the status of a passenger for a specific flight. The passenger is not confirmed but has been listed for the flight and is awaiting confirmation.
56 Vendor Provider of a travel service to agents. Vendors may be airlines, hotel chains, car rental firms or any other provider of services which may be sold through a CRS.
57 Yield Control Philosophy applied to many systems which attempts to maximize the income of the vendor by restricting sales of low-yield products in favor of higher yielding alternatives. For example, selling full-fare seats rather than discounted excursion seats. This may be achieved for example by manipulation of the status sent to distribution systems in an availability response by disallowing the sale of short haul flights unless in conjunction with a long-haul flight of the same vendor.  The term "Revenue Management" is also applied to this process.