Saturday, June 20, 2020

Core java +Selenium Webriver+Real Time Interview Session + Resume Preparation

===================
A) Java Fundamentals:-
---------------------
1)Identifiers
2)Reserve words
3)Datatypes
4)Literals
5)Type Conversion
6)Type Casting 
7)Arrays
8)Types of Variables
9)Types of Methods
10)Coding Standard
b)Java Language concepts:-
-------------------------
1)Packages
2)Accessibility
3)Variables and types of variables with respect to Execution
Modifiers
4)Methods and types of variables with respect to Execution
Modifiers
5)Block and types of Block
6)Class and types of Class
7)New keyword and constructor and types
8)static Members and their control flow
10)static and non-static members control flow including super
class
11)final variables and their rules
12)this and super keywords rule and use
13)Compiler responsibility and Compiler code conversion
14)JVM Architecture and responsibility
15)OOPs fundamentals,concepts and Principle
16)Types of Object and Garbage Collection
17)Inner Classes
18)Arrays and Var-args types
19)Control Statement
20)Collections
23)Wrapper Classes
24)Exception Handling
25)string Handling
=====================

Selenium Syllabus
=================
1>Download and Install Java
2>Configure Setup-Eclipse,Selenium,TestNG
3>Difference between Webdriver, RC and IDE
4>How to execute testcases in IE browser using Selenium Webdriver
5>Challenges with IE browser in Selenium Webdriver
6>XPath plugin for Firefox
7>Complete stydy of Dynamic XPath in Selenium
8>XPath plugin for Chrome
9>How to verify Page title in Selenium Webdriver
10>How to work with Radio button and Checkbox in Selenium
Webdriver
11>Handle Basic Dropdown in Selenium WebDriver
12>Guide to perform Drag and Drop in Selenium
13>How to perform Advance activity in Selenium like- Mouse Hover,
RightClick, DoubleClick, Keyboard Event
14>Implicit wait in selenium Webdriver
15>Explicit Wait in Selenium Webdriver
16>Fluent Wait in Selenium Webdriver
17>How to capture error message in Selenium Webdriver.
18>How to handle frames in Selenium Webdriver
19>How to handle Alert in Selenium Webdriver
20>How to handle Calender in Selenium Webdriver
21>How to capture Screenshot in Selenium
22>How to capture screenshots of failed test cases in Selenium
Webdriver
23>How to capture tooltip in Selenium Webdriver
24>How to scroll page in Selenium Webdriver
25>How to handle Exception in Webdriver
26>Solution for java.lang.illegalstateexception in Selenium
Webdriver
28>How to handle Element not visible exception
29>Solution for sendkeys(CharSequence) in Selenium
30>How to Handle Stale element reference exception in Selenium
Webdriver
31>Difference between findElement and findElements in Selenium
Webdriver
32>- Page Object Model in Selenium – Complete Guide
33>Read and Write Excel file in Selenium using Apache
34>Data Driven Framework in Selenium
35>Maven Integration with Selenium
36>Configure Eclipse with Selenium and TestNG
37>Create First TestNG Program and Execute.
Configure Eclipse with Selenium and TestNG
38>Check reports generated by TestNG
39>Cross browser testing using TestNG
40>Create Data driven framework using DataProivider
41>How to execute only failed testcases in Selenium Webdriver
42>How to disable test case in Selenium using Testing
43>How to group Test cases in Selenium using Testing
44>How to create dependency between Test cases in Selenium
Webdriver
45>How to execute testng.xml file through Java Program
46>Execute Selenium Webdriver Test cases parallel using TestNG
48)Git
49)Jenkins
50)Framework from scratch
1)Develop Maven project (How to configure maven)
2)Create Page Object model
3)Create Base class
4)create utility class
5)create Handler class
6)Run all test cases using XML file
7)Create log4j
8)Take screenshot for fail test cases
================================
Demo Interview Session 
Real Time Project 
Resume Preparation 

Saturday, June 13, 2020

Page Object Model In Selenium

Step1:- Create Base Class.

package com.pageobjtest;

import java.util.List;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;

public class Base {
public static WebDriver driver;
public static String url="https://www.facebook.com/";
//public static String url="http://demo.guru99.com/test/social-icon.html";
public static String path="C:\\Users\\user\\Desktop\\Driver\\chromedriver.exe";
public static String date="25";
public static void config(){
System.setProperty("webdriver.chrome.driver",path);
driver=new ChromeDriver();
driver.get(url);
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
}
public static void closeBrowser(){
driver.close();
}
public static void quitBrowser(){
driver.quit();
}
public static void testCasePassed(){
System.out.println("*******Test case Passed *******");
}
public static void testCaseFailed(){
System.out.println("*******Test case Failed *******");
}
public static int findNoFrame(){
int noOfFrame=driver.findElements(By.tagName("iframe")).size();
System.out.println(noOfFrame);
return noOfFrame;
}
public static void switchParentFrame(){
driver.switchTo().defaultContent();
}
public static void switchOnFramIdName(String str){
driver.switchTo().frame(str);
}
public static void scriptExecutedSuccessfully(){
System.out.println("Script is Executed successfully");
}
public static void compareText(String actual,String expcted){
if(actual.equals(expcted)){
Base.testCasePassed();
}
else{
Base.testCaseFailed();
}
}

public static void moveToElement(WebDriver driver,WebElement ele){
Actions act=new Actions(driver);
act.moveToElement(ele).perform();
}
public static void dyamic_Table(){
driver.findElement(By.xpath("//label[contains(text(),'Return Date')]")).click();
List<WebElement> list=driver.findElements(By.xpath("//div[@id='rb-calendar_return_cal']//td"));
for(int i=0;i<list.size();i++){
String listOfdate=list.get(i).getText();
System.out.println("*********** listOfdate **************" +listOfdate);
if(listOfdate.equals(date)){
list.get(i).click();
break;
}
  }
}
}
========================================================================
Step2:- Create Login Page .

package com.pageobjtest;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

public class LoginPage {
WebDriver driver;
By userName=By.id("email");
By password=By.id("pass");
By loginbt=By.xpath("//input[@value='Log In']");
LoginPage(WebDriver driver){
this.driver=driver;
}
public void getuserName(){
driver.findElement(userName).sendKeys("mohitkmr680");
}
public void getpassword(){
driver.findElement(password).sendKeys("password");
}
public void clickOnLogin(){
driver.findElement(loginbt).click();
}

}
=========================================================================

Step3:- Create Test Runner Class.
package com.pageobjtest;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;

public class LoinTestRunner extends Base{
//WebDriver driver;
@Test
public void tc_01(){
/*
System.setProperty("webdriver.chrome.driver","C:\\Users\\user\\Desktop\\Driver\\chromedriver.exe");
    driver=new ChromeDriver();
    driver.get("https://www.facebook.com/");
    driver.manage().window().maximize();
    driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
    */
Base.config();
    LoginPage page=new LoginPage(driver);
    page.getuserName();
    page.getpassword();
    page.clickOnLogin();
    
}

}
=========================================================================

Q)How to create Page Object Model Using PageFatory class .

Step1:- Create Base Class.

Step2:- Create Login Page .
package com.pompagefactory;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

public class LoginPageFB {
WebDriver driver;
public LoginPageFB(WebDriver driver){
this.driver=driver;
}
@FindBy(id="email")
WebElement userName;
@FindBy(id="pass")
WebElement password;
@FindBy(xpath="//input[@value='Log In']")
WebElement loginbtn;
public void loginFaceboo(String UserName,String Password){
userName.sendKeys(UserName);
password.sendKeys(Password);
loginbtn.click();
}
/*
public void getuserName(String username){
userName.sendKeys(username);
}
public void getpassword(String Password){
password.sendKeys(Password);
}
public void clickOnLoginBtn(){
loginbtn.click();
}
*/

}
=========================================================================
Step3:- Create Test Runner Class .
package com.pompagefactory;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.PageFactory;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

import com.pageobjtest.Base;

public class TestRunner extends Base{
@BeforeTest
public void setUp(){
Base.config();
}
@Test
public void tc_01_Fb(){
LoginPageFB page=PageFactory.initElements(driver,LoginPageFB.class);
/*
page.getuserName("mohit@gmail.com");
page.getpassword("password");
page.clickOnLoginBtn();
*/
page.loginFaceboo("mohit1@gmail.com","12345");
  }
@AfterTest
public void tearDown(){
driver.close();
}

}













Friday, June 12, 2020

File Handling in Selenium


       






    Q)How Read data from Excel .
   




Q>How to read data from the multiple Column 

OR
====


Q>How to read data from the multiple Column .




Q>How to read data from the multiple Row



Q>How to Write Data from Excel?



oR









Q) How To Find Duplicate Characters In A String In Java?

Step1:- Creating a HashMap containing char as key and it's occurrences as value. Step2:- Converting given string to char array. Step3:- ...