Manual testing is a process of validating the functionality with the help of human resources(QA Eng) Automation testing is a process of validating the functionality with the help of tools and technology. Main goal of automation testing is increase the automation coverage same time. Automating the test case is nothing translating the "Manual Test Case" into "Automated Test Case". Ex: Login Test cases 1.Open Browser ----> driver = new ChromeDriver(); 2.Launch the application ---> driver.get("www.gmail.com") 3.Enter username --->driver.username.sendkeys("username") 4.Enter pwd --->driver.password.sendkeys("pwd") 5.Click login button --->driver.loginbtn.click() Expected result:login should success and homepage should display Selenium 1. Core Java Selenium is an automation tool kit which helps you to automate web application test cases. Selenium supports multiple languages core java Important Topics: -->Variables -->Data Types -->Operators -->For loop -->While loop -->Do-While Loop -->If-If else -->OOPS(Object Oriented Prg lang) ----->Abstraction ----->Encapsulation ----->Inheritance ----->Polymorphism -->Exception Handling in Java--sudden error comes how to handle. -->File Handling -->Interface -->Java collections. Selenium Webdriver tool kit contains a bunch of methods(library of methods) by using these methods we can operate webelement on a webpage. Three simple step process in Automation 1.Identify the address of a webelement on webpage. 2.Perform an action on a webelement. Repeat first 2 steps until you reach functional point 3.Validate the results(Expected Results Vs Actual Results) Automation Framework --->DataDriven --->Modular Approach --->Keyword Driven --->BDD(Behaviour Driven Development) --->Hybrid --->POM--Design pattern used in frameworks Automation Framework Tools --->TestNG -- Text Next Generation Automation framework tool --->cucumber -- BDD Framework. There is some sample application in which we will play with automation how to install java and selenium and any other supporting tools GITHUB Java helps in removing pointer, operator overloading Distributed: servers are interconnected india : google.co.in .Depends on geographical location nearest server will be connected. Multithreaded: 1GB - 1min 4GB - 4min each thread 1GB- 1min 1GB- 1min 1GB- 1min 1GB- 1min Components of JAVA --JDK--JAVA Development kit --JVM--Java Virtual Machine computer only understand machine language source code our code---.java file compiler convert source code to machine language -- .class file JDK contains - compiler, debugger, JVM other libraries Java source code (.java extension) -- our code java compiler(javac) java Byte code(.class file extension) JVM--understands Every java program has class Main method: Execution starts from the main method JRE starts from the main method. File name and class name should be same Installing JDK Installing Eclipse IDE ====================== Installation of Java Java is available in two forms ---->JRE-Java Runtime Environment(JVM and other libraries) -- To run the programs , run the eclipse ---->JDK-Java Development Kit(java compiler + JRE+ Debugging tool+ Doc related libraries)--write the programs and compile the programs. URL: https://www.oracle.com/java/technologies/downloads/#jdk17-windows We can write java programs using notepad but editors have lot of advantages. Highlight the syntax errors and we can create the project with the help of editors. Installing Eclipse IDE: workspace -- Project -- SRC-- Package-- Java Programs Every java program is a class file. Access Modifiers: public Default protected private public mean we can access from anywhere. with public only we can access main methods. Static is keyword will represent unique instance for access. void does not return int a a = variable which can hold integer data(numbers) What is variable? variable is a place holder which can hold some value. Ex: a= 10; name = "Raja" What is Data Type? Data Type is some thing which defines what kind of data we are storing in the variable. Ex: int -- store numbers string -- to store text float-- decimal values Boolean -- true or false double -- decimal values Variable a= 10, b = 110.56 and c ="india" Data Type: is something which tells what kind of data can be stored in a variable. 1Byte = 8bits 1bit = 1/0 Short = which can store numbers(2 Bytes) int = which can store numbers(4 Bytes) Long = which can store numbers(8 Bytes) float = which can store decimal numbers(4 Bytes) double = which can store decimal numbers(8 Bytes) char = Which can store a single character/letter(ex. char option = 'y') Boolean = which can store TRUE(1)/FALSE(0) Non-Primitive Data Types: String - which can store alphanumeric and special characters. ex: String name = "Rama Krishna" String passcode = "!@Admin123" Array --> int marks[] = {34,23,56,67} String flowers[] = {"lilly", "Rose","Jasmine","Tulip"} int a = 100; char ch = 'Y'; double rate = 110.86; Boolean option = false; String name = "India" Operators ========== Athematic Operators --> +,-,*,- Assignment Operators --> +=, =, -= a+=1 // a = a+1 a-=1 // a = a-1 unary operator = a++--> a = a+1; ++a a-- Relational Operators: ==, !=, < , >, <= ,>= Logical Operators ||(Logical OR) , $$(Logical AND) Decision Making statements: ============================= IF (condition True){ //Execute this block }else{ //Execute this block } Ex: IF(Adhar ID is available || Driving License is available){ Allow the person } Otherwise { Dont allow the person } Even or odd number ---------------- int number; number = 20; if(number%2 == 0){ system.out.println("even number"); } else{ system.out.println(" not even number"); } Homework: Find out largest value out of 3 given numbers ex a = 100 b = 50 c = 200 Looping Statements: For Loop: A block of statements will repeatedly execute as long as the condition is satisfied. While Loop : A block of statements will repeatedly execute as long as the condition is true. Ex: write a prg to print 100 to 1 numbers. int i = 100; while(i>=1){ system.out.println(i) i--; } do while string word = "aaacdaf" how many times a character is repeating in the word == a 0 1 1 2 3 5 int pnum =0; int nnum =1; int sum =0; sum = pnum+nnum; /3 pnum = nnum;/1 nnum = sum;/2 int a[] = {1,4,5,7} int b[] = {6,4,3,7} int j =0; for(int i =0;i = new Scanner(System.in) Ex: Scanner input = new Scanner(System.in); int amount = input.nextInt(); problem: user is giving input in Indian rupees we need to convert that amount in to USD. Class Vs Object: Class is a blue print which contains a composite data structure i.e different data items. class can contain variables and methods. Object is an instance of the class which contains physical memory representation. class student: int studentid string student name int student phone num string studentaddress student st = new student(); st.studentid = 101; st.studentname = "radha" st.studentaddress = "hyd" OOPS: Variable,Data Type, IF, For, while, Do-while,operators class - object -method object oriented principles in java. int a = 1000; person{ -->Aadhar ID -->Name -->phone number -->Address } Behaviour -- Action -->cool -->Anger A java class can contain Data members(variables) and then behaviors(Methods) A class is like blueprint which contains properties and methods. object is an instance of the class which contains physical memory representation. 4 principles in OOPS 1.Encapsulation 2.Abstraction 3.Inheritance 4.Polymorphism Encapsulation : Binding the data and behavior to provide more security. Encapsulation depends on access type java automatically provides security The idea of binding data and methods that work on that data within one unit. Inheritance: Acquiring the properties from the parents. A class can have a parent class Ex: A parent is having some properties and methods(Ex: House, cardriving) A child can use parent properties. A parent can have more than one child. A child cannot have more than one parent. we have multiple levels Grand parents--parents--child--subchild Polymorphism: Same method with different signatures Two types of polymorphism 1. Compile time -- Method overloading Method will be same ... we have different parameters add(int a, int b) add(int a, int b, int c) add(double a, double b) 2. Run time -- Method overRiding Constructor: A constructor is a special method in java which is used to initialize the objects while creation. Car Factory A customer wants to purchase swift basic model LXI then total cost is 550000 base price = 500000 Swift_LXI: onroadprice = baseprice + 50000 seatcovers = null airbags = null Swift_VXI: onroadprice = baseprice+150000 seatcovers = leather seat covers airbags = null Swift_ZXI onroadprice = baseprice+250000 seatcovers = leather seat covers airbags = 6 airbags Tata Nexon: Model 1 - basic model model 2 - airbags/built in camera/auto mode model 3- Autogear Exception Handling in java ============================= constructor means initialize the object or else default constructor will be there. An exception is nothing but an interruption in the program execution in anyway. Simple syntax: Try{ // business logic } catch(Exception e){ //Alternate or workaround logic -- customized error message to user //Error message - saving in a log file } Finally{ //Always executes this block ex: It clears user login details from the browser cache. } use case:1 As a user i logged into Netbanking trying to transfer money to my friend. in between suddenly bank server issue came. Then netbanking user get some message like "oops there is some issue with bank server please try again after some time" Use case:2 : Exception based on the user defined rule. user went to pub To get an entry he/she needs to scan Aadhar/SSN card[Min age limit is >=18] if(user.age>=18) then print allowed else print not allowed. With respect to automation testing how this Exception Handling is useful. Data Driven -- I read the test data from files -->File Handling Exceptions Ex: File not found File no write permission(Read only) ----->Webelements(Ex: Textbox,button,dropdown,scroll bar, label, link etc) --->Ex: No Such WebElement found Quick Recap in Java Basics: -------------------------- 1- Variables in Java 2- Data Types 3- Parameters 4- If condition 5- For Loop 6- While Loop 7- Do-while loop 8- oops concept Encapsulation Abstraction Inheritance Polymorphism 9- Class Vs Object 10-Java methods 11.Java constructor 12.Java Exception Handling 13.Kicking off Automation basics selenium Selenium Basics: Selenium is a web driver tool kit its an automation tool for web application test cases. Selenium is not an programming language we need programming language for support(like java, python,Ruby etc) Web driver Tool Kit: it contains "methods" these methods will help us to operate on the web elements in a webpage. What is webelement: A webelement is an entity or object or property on the webpage. webpage is built combination of different webelements. Ex: Textbox label Dropdown URL Button Date calendar scroll Bar radio button check box etc Three simple Automation steps 1. Identify the address of a webelement in webpage. 2. perform an action on the web element. repeat 1 and 2 steps until you reach the functional point. 3. validate the results(Expected Result vs Actual Result) if both are same then test case is pass otherwise test is failed. ---------------------------------------------------------------------------- How to install selenium we bdriver tool kit. The tool kit contains bunch of jar files. ---------->These jar files contains java packages. ---------->These packages contains class files. ---------->These class files contains java methods(selenium methods) open the below URL: https://www.selenium.dev/downloads/ download selenium java zipfile. Extract the downloaded zipfile. on the context menu select build path-- select configure build path click on the libraries tab. select class path if present in library tab. click on add external jar. Select all selenium jar files available from extracted folder. Apply and close. chromedriver download: C:\Users\chava\Downloads\chromedriver-win64 (4)\chromedriver-win64\chromedriver.exe C:\\Users\\chava\\Downloads\\chromedriver-win64 (4)\\chromedriver-win64\\chromedriver.exe http://webapp.qedgetech.com/login.php If the class is in different package we have to import that. 3 simple steps: 1.Identify the address of a webelement in the webpage. 2.Perform the action on a web element. repeat 1 and 2 steps until you reach functional point. 3.validate the results(Expected Result Vs Actual Result) 1. How to identify the address of a webelement. Every webpage has HTML structure as source code. HTML DOM Structure --- Document Object Model Each parameter has some value Every webelement on the DOM structure may have set of parameters and its values. we can use one of the unique parameter to locate the address of the webelement. since we have the address hence in selenium we can also call these parameters as locators. Username: type, name , id ,class we need to find the address of the webelement by using these locators. A method findElement() is used to find the address of the webelement. Syntax: driver.findElement(By.id("username")) -- it will fetch the address of the webelement username. 2. password driver.findElement(By.id("password"))-- it will fetch the address of the webelement password. To input some text in the textbod --"sendKeys()" method can be useful. WebElement username = driver.findElement(By.id("username")); username.sendkeys("admin") WebElement password = driver.findElement(By.id("password")); password.sendkeys("master"); WebElement loginButton = driver.findElement(By.id("btnsubmit")); loginButton.click(); Manual Testcase: TC-1: valid login : verify user is able to login with valid user credentials. steps: 1. open the browser -- Webdriver driver = new chromedriver(); 2. launch the application -- driver.get("http://webapp.qedgetech.com/login.php"); 3. Enter valid username -- driver.findelement(By.id("username")).sendkeys("admin")); 4. Enter valid password -- driver.findelement(By.id("password")).sendkeys("master")); 5. click on loginButton -- driver.findelement(By.id("btnsubmit")).click; Expected Result. 6. verify login is successful and home page displayed. TC2-Logout verify user is able to logout from application Steps: 1-Open the browser 2-launch the application 3-Enter valid username 4-Enter valid password 5-Click on login button 6-Click on logout what is common in both login and logout test cases Login code is common in both the test cases To avoid these duplicate coding we can use java methods for reusability of code. let see how to write a login function in a method. Test case-4 verify when user clicks on reset button both the username and password fields should become empty. Steps: 1-Open the browser 2-Launch the application 3-Enter username 4-Enter password 5-Click on reset button 6-validate username and pwd fields should become empty. WebElement username = driver.findelement(By.xpath("//input[@name = 'username']"); WebElement password = driver.findelement(By.xpath("//input[@name = 'password']"); WebElement loginButton = driver.findelement(By.xpath("//button[@name = 'btnsubmit']"); AccesModifiers: public -- Across the project we can access that element or method private -- only with in the class Default -- only with in the package protected -- with in the same package and sub-class from other package. //button[@id = 'u_0_5_7X'] //button[@id = 'u_0_5_1b'] //button[starts-with(@id , 'u_0')]--- starts-with following following- sibling --->right person identified preceding - sibling -->left person identified parent child Ancestor Descendant whenever you don't have right identification you will see particular landmark //input[@id = 'username']//following :: input[@id = 'password'] Selenium Wait Statements: There are two things in our automation 1- selenium script --- Fastest one 2- WebApplication --- Typicall delays Example Testcase: ->Open a browser ->Launch the application--To launch the application it takes sometime to load the complete page ->Enter username-> it tries to locate the webelement(username)-- input the username. Time synchronization issues will be there in the automation until webapplication loads we need to stop the script All are dynamic. Dynamic wait statements -- Implicit wait and Explicit wait static wait -->Traffic light example Thread.sleep(10000);10 sec Dynamic wait -- 30 sec--maximum time Explicit wait -- Don't require to wait for all the elements. only certain webelement visibility element to be clickable for every 250 milli seconds it polls for the webelement clickable/visible/texttopresent() 1 second -- 4 times it polls for the availability of the webelment 10 seconds -- 40 times it checks for the webelement position Action Classes: library from selenium Actions actions = new Actions(driver); Actions = class name actions = object name driver is my browser reference Sample Test case with Actions class method usage; TC-005:Verify user is able to open stock categories page. Steps: 1.Open the browser 2.Launch the application 3.Login as admin 4.Navigate to stockitems Menu -> Stock categories 5.Click on stock categories 6.Verify stock categories page displayed or not With in the double quotes java identify it as a string. SELECT CLASS in selenium: Locate the dropdown element using its ID,name,class, Xpath etc WebElement dropdownElement = driver.FindElement(By.id("dropdown")); // create a select object by wrapping the dropdown element Select dropdown = new Select(dropdownElement); //select an option by visible text dropdown.selectbyvisibletext("option 1"); Sample Test case: TC7- CreateStockItem steps: 1.Open Browser 2.launch the application 3.login as admin 3.Click on stockItems menu 4.click on Add(+) button 5.Fill up all the fields in Add Stock Item Page. 6.click on Add button 7.click on OK on the confirm popup 8.click on add succeeded pop up window 9.validate the stock item added or not. Automation Frameworks: Without framework we cab able to automate the test cases then what is the need of automation framework. 1. What if i wanted to run multiple test cases together(ex-100 Test cases to be run at one go) 2. what if all QA Engineers are not maintaining the automation script uniformity. 3. Maintenance work can be reduced. 4. Some of the other capabilities like reporting, failed test cases 100 Tcs -- 50 passed and 50 Failed only run the failure test cases and again 40 pass and 10 failed. again run only 10 test cases. Manually it takes lot of time. Automation Framework Concepts 1. Data driven concept 2. Modular approach 3. Page Object Model(design pattern) in automation frameworks 4. BDD Approach - Behavior Driven Development -- both manual and automation 5. Hybrid model - when we combine more than one concept or framework is nothing but hybrid. Data Driven: Externalizing the Test Data from the test scripts. Dependency we are creating by giving fixed values. so test data can be externalized that may be any file. so same scripts are applicable to all the scrum teams. In data driven we can read test data from the EXCEL/XML/TXT files and pass into Test Scripts. In case if we need to change the test data no need to update the script just update the file. Multiple scrum teams - different test env they will update data not test scripts test scripts will be same for all the teams environment and data can be changed. Data driven useful for big data with less code we can use this data In every company any project data driven concept is a must kept concept in the framework. Automation Framework Tools: 1. TestNG Automation Framework Tool(Set of libraries-- jar files) 2. Cucumber Framework (BDD Approach) some companies use combo both frameworks. TESTNG Frame Work Tool ========================== TestNG -- Test Next Generation its a automation framework tool we can use it to automate unit test cases to integrate the test cases. Automation framework provide a standard systematic approach for an automation, which also includes different capabilities which can ease and faster our automation work. Task- washing the clothes -->A bucket, soap and water --> JDK,EclipseIDE,selenium Task : washing the clothes using washing machine with soap and water. Automation Framework --> Additional Capabilities what all are the different capabilities we can use in TestNG? 1. we can able to run multiple testcases at one go 2. we can prioritize the test execution order. 3. we can see the Test Execution status reports in HTML format. 4. we can only run Failed Testcases in TestNG 5. we can use Annotations like @Test,@BeforeMethod,@AfterMethod annotations will tell when to execute we will write method and above annotation. 6. We can use Assert class methods for validations ex: assertTrue(actual,expected) assertTrue(condition) assertEquals(Actual o/p, Expected o/p) 7. we can have @Dataprovider supports enables Data Driven concepts. 8. we can multiple TestNG class files as an Automation Suite. ================================================================ How to install TestNG in EclipseIDE 1. Open the Eclipse IDE 2. Help--> Select Eclipse Marketplace 3. Eclipse MarketPlace window will open 4. Search for "testing" and enter: it results in TestNG plugin 5. Click on TestNG - install TestNG install window will open 6. unselect the 2nd checkbox(maven integration), continue to install 7. During install, if you encounter any popup Trustall, accept and continue to install . 8. TestNG installation successful. ==================================================== How to check the TestNG installation. 1. Open your Eclipse IDE 2. Go to help -- Eclipse marketplace. 3. search for 'testNG' in the find bar 4. In search results the testNG plugin will have installed state. Another check: 5.Right click on any package on your project. 6.On the context menu check for TestNG Option. ================================================== How to create a simple TestNG class file. 1.Open the Eclipse 2.select your project-->on any package -->Right click on it 3.On the context menu -->TestNG-->Create TestNG class(select) 4.New TestNG class window will open, Enter the class Name and click on 'Finish'. How to write sample script using TestNG capabilities: 1.Able to run multiple test cases at onego 2.we can see html reports provided by TestNG Framework 3.@BeforeMethod, @AfterMethod @BeforeMethod -- For every test case before method is called 4. Failed Test cases ---> Example we have 100 Testcases --> we ran in TestNG we will have failed test cases testng-failed.xml - when we run this only failed test cases is to be executed. Automating a testcase using TestNG @Test annotation -- Below method is a test case @Before Method -- will execute before test case @After Method -- will execute after every test case @Before Test -- will execute before all the test cases @After Test -- will execute after all the test cases. By using single TestNG class file(LoginModule.java) we can add and run multiple test cases. Invalid login: //enter invalid username //enter invalid password //click on the login button In TestNG Framework we can run multiple TestNG class files together Ex: 1.LoginModule.java 2.HomePageModule.java 3.StockItemsModule.java TestNG provides xml configuration by using this we can run what all the TestNG class files to be run as part of out automation suite. How to set the execution order in a testcase. @Test(priority = 1) by setting priority for the test cases if i don't set the order how TestNG execute the test cases a)Random order b)sequential order c)Alphabetical order d)None of the above Ex: @Test public void Srinivas() { } @Test public void amar(){ } public void Vindhya(){ } How data driven works in TestNG? Read the data from external file and pass into the test script. @Data Provider --- we can implement data driven Internal Data Provider -- which provides "Test Data" with in the class file External Data Provider -- Which reads the data from the External file(ex: from Excel file) --More Recommended is External Data Provider. Print student detail By using the Data driven we can externalize the test data from the test scripts. we need to update(add/ modify) test data with out touching the test scripts. I don't want others to touch the script then go for external data. POM--Page Object Model...xpaths(Address of the webelements) should be externalized from the testscripts ObjectRepository---POM is a design pattern. POM is a design pattern to create object repository. Object Repository - can contain all the webElements addresses and test scripts. Will refer Object Repository to use webelements. Advantages: we can separate out all the xpaths from the Test Scripts so that it will be easy for maintenance. Ex: previous version JDK 1.7 and Tomcatserver -8 now the version changed to JDK 12 and Tomcatserver - 10 UI is updated with latest designs all the webelements change so all the xpaths will change. solution is update each and every test case - lot of overload and maintenance 3 -4 months. In object repository -- xpath is referred as element x. we are using element x not xpath -- only one place xpath will be changed This change will cutoff the maintenance. Object Repository Externalizing the web address elements. Data Driven -- Externalizing the data In Object Repository we are creating multiple java files. For every webpage we are creating a class file. Object Repository Loginpage.java ---->username == xpath for username ---->password == xpath for password ---->loginbutton == Xpath for login button ---->reset button == xpath for reset button like this we can define webelement addresses which belong to that page. Homepage.java It contains all the webelements related to home page. Every page contains a webelements Automation Framework Structure: By using data driven -- Externalize data By using POM xml file --Externalize web element addresses. Test Scripts: TestNG or cucumber Test Data -- Data management programs -- Apache POI --- @dataProvider Another concept is POM-Object Repository -- more efficient and less maintenance. After execution Test Reports will be created. There are external libraries to create extent reports. Whatever the common methods will be there. Test reports,Test data , utilities and common methods are helpful for the test scripts. Cucumber ========== BDD-- Behavior Driven Development Non Technical members also can contribute in automation. Who can be Non Technical members in your team 1.Business Analyst 2.Manual Test Engineers Three simple step process in Automation step-1: Create the feature files Feature file contains Test Steps in simple English language with Gherkin keywords. step-2: Create step Definitions for each step in feature file. Step Definition is a method which will contain automation code. step-3: Test Runner file,by using Test Runner file, we can execute the feature files. Manual Test engineers directly create test case in BDD format How to install cucumber. 1.Open your Eclipse IDE 2.Go to help -->Eclipse Market Place Eclipse Market Place window will open 3.Search for 'cucumber' In Results, Cucumber -- Eclipse plugin will display 4.Click on install button and complete the installation process Cucumber needs more libraries Cucumber Junit and cucumber java libraries. By creating a simple Maven project and then we can get all the required dependencies. Maven is Build Automation Tool which has a bunch project templates and build life cycle phases. -->Maven has POM.xml 1. Create a simple maven project in Eclipse IDE 2. Open POM.xml (Project Object Model) mvnrepository.com To add dependencies update dependency in POM.xml create a Folder -- Features -- Test1.feature src/test/java - step definition package, Test Runner package Feature: Login functionality All Login Testcases automated here @tag1 Scenario: TC1 - Verify user is able to login with valid credentials Given : user launches the application When : user enters the username,password and clicks on login button Then : Validate login page Cucumber Framework: cucumber follows BDD Approach BDD: Behaviour driven development Three simple step process in automation 1.Creating the feature files -- A feature file contains test scenarios with steps in simple English language using gherkin keyword 2.Writing step definition file -- Here in step definition we can have automation code for every step mentioned in the feature file 3.Test Execution -- using Test Runner class file -- we can configure what all the feature files to execute. @CucumberOPtions Features = LoginModule, Home page module Glue = where we have steps dryRun = false It will start executing the testcases dryRun = true --Its a mock run its not exact run. it will check every method has (). It will scan and check missing methods. Target --reports will be there any time. you can share with the stakeholders Monochrome = True -- readable format Monochrome = False -- data is not in a readable format Tags = only specific tags will be executed tags = ("@smokeTest") --> DataDriven capability in cucumber we can pass the test data by using feature file itself. When user enters the "", "" and clicks on login button Examples: |username| password| |admin | master | what are the different components Manual test cases we convert it into Test scripts that is automation scripts Test scripts- java We have to download the latest version of selenium we can have bunch of frameworks TestNG and Cucumber TestNG: Multiple test cases, html reports, run only failed test cases, set the order, mention dependency test cases , use annotations @Before, @After TestNG has a validation method called assertclass compare the expected result with the actual result. BDD- Cucumber Non Technical Engineers included in feature files Product owners and Business analyst will analyze. Some companies use both the framework to take advantage of both the two. My test case should contain only business logic no dependency should be there then i need to use some framework concept which is nothing but pageobject Pageobject is the one which will have all the addresses of the webelements . Next we need test data from test data i will read test data and use it in my scripts. Keep test data in excel format , excel can have number of rows and number of columns. Apache POI libraries App utilities : login method,Open browser, close browser, open application and close application. we are creating common methods. some companies they will have single file which contains all these methods. For test cases we can directly call app utils. Xpaths are changed we no need to update the test scripts In TestNG -- we can configure html reports and in cucumber @TestRunner if a framework is ready page objects, test data, framework then it will be very easy to write automation scripts. To download all the dependencies we need some file called maven. Maven contains lot of project templates. POM xml contains a repository it will get all dependencies from the repository by using we can create a simple project structure. The total automation source code we need to save it GitHub is one of the centralized location . Not only my work all other team members work will be saved in GITHUB. Any new member joins they will get the code from GitHub they may modify the code or change the code. PULL operation will get the latest code to my system. I want to push latest code then i have to use Push operation. Every day we will do pull and push operations. Newly joined in the team scrum master will give you GitHub access. Devops-- Build env development for dev team Test env development for QA team QA and Dev Team they focus on the core activities. Builds will be in FTP server we can download our builds here CI/CD -- Continous integration and continuous development Coding --->compile--->build dev by 11pm compile and build will be deployed. Automate this process called Jenkins Jenkins-- Create a work flow after check in code in GitHub I can put a timer every 11pm i get the code and trigger the alarm in maven. Maven will get latest code and create a build. Automation perspective - 6AM Test env ready with latest build as a QA team run automation suite on the latest build -- 3 hrs to run So we can create an agent by using Jenkins --When alarm is on it will trigger the script. The test report will be generated and these reports are emailed to the specific person. Automation ============ Java does not support multiple inheritance. if multiple classes have same methods then compiler does not identify which method to execute and it becomes ambiguity problem. Since compile time errors are better than runtime errors if you inherit 2 classes whether you have same method or different there will be compile time error but interms of interface you can achieve multiple inheritance Challenges in automation: 1.unstable application 2.Frequently changing features 3.Frequently changing test data 4.Handling pop ups Monkey testing: Monkey testing refers to Adhoc testing testing the application to break it's functionality usually people won't have test cases for this kind of testing.Just doing by knowing the entire application and trying to break it without proper test case. How to handle pdf scroll down? javascriptExecutor js = new(javascriptExecutor)driver; js.executorscript("window.scrollBy(0,1000)"); why can't we use constructors instead of methods? The purpose of constructor is to initialize the object of a class while the purpose of a method is to perform a task by executing java code.Constructors cannot be abstract,final,static and synchronized while method can be. Constructors do not have return types while method do. OOPS: 1.Abstraction 2.Interface 3.Inheritance 4.Encapsulation Method Overloading: If a class has multiple methods having same name but different in parameters it is known as method overloading. Method Overriding: If subclass or child class has the same method as declared in the parent class it is known as method overriding. Thread.sleep: is used to pause the execution for defined time.Time is defined in milliseconds for this method. Type of Exception in java 1.ArithmeticException 2.ArrayIndexOutOfBoundsException 3.NullPointerException 4.ClassNotFoundException 5.FileNotFoundException 6.IOException 7.Stackoverflow exception' 8.Interrupted Exception 9.NoSuchFieldException 10.NoSuchMethodException 11.NumberFormatExceptions Selenium Exceptions: 1.ElementNotVisibleException 2.NoSuchElementException 3.NoSuchWindowException 4.NoSuchFrameException 5.NoAlertPresentException 6.InvalidSelectorException 7.ElementNotSelectableException 8.TimeOUtException 9.NoSuchSessionException 10.StaleElementReferenceException.