<file_sep>package com.jbk.sopan.AdminLTE;

import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;

import com.aventstack.extentreports.utils.FileUtil;

public class Utilty {
	
	 static WebDriver driver;
	public static String Scrrenshort(WebDriver driver) {
		
		TakesScreenshot ts=(TakesScreenshot) driver;
		
		File src=ts.getScreenshotAs(OutputType.FILE);
		
		String des=System.getProperty("user.dir"+"/scrrenshort"+System.currentTimeMillis());
		
		File destination=new File(des);
		
		try {
			FileUtils.copyFile(src, destination);
		} catch (IOException e) {
			System.out.println("capture failes"+e.getMessage());
		}
		
		return des;
	}

}
<file_sep> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.jbk.sopan</groupId>
  <artifactId>AdminLTE</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>AdminLTE</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
  <!-- https://mvnrepository.com/artifact/javax.mail/mail -->
<dependency>
    <groupId>javax.mail</groupId>
    <artifactId>mail</artifactId>
    <version>1.4</version>
</dependency>
  <!-- https://mvnrepository.com/artifact/javax.activation/activation -->
<dependency>
    <groupId>javax.activation</groupId>
    <artifactId>activation</artifactId>
    <version>1.1.1</version>
</dependency>
  
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>3.17</version>
</dependency>
    <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>2.53.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi</artifactId>
    <version>3.7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.github.yev/screenshot -->
<dependency>
    <groupId>com.github.yev</groupId>
    <artifactId>screenshot</artifactId>
    <version>0.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi</artifactId>
    <version>3.0.1-FINAL</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.aventstack/extentreports -->
<dependency>
    <groupId>com.aventstack</groupId>
    <artifactId>extentreports</artifactId>
    <version>3.0.2</version>
    <scope>provided</scope>
</dependency>

    <!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.9.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.17</version>
</dependency>

    
  </dependencies>
</project>
<file_sep>package com.jbk.scrrenshort;

public class demo1 {

}
<file_sep>package com.jbk.scrrenshort;

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

public class GenerateLog {
	
	
	
		public void demo() {
			
		
	Logger log	=Logger.getLogger(GenerateLog.class);
	
	System.setProperty("webdriver.chrome.driver", "E:\\softwae\\chromedriver_win32\\chromedriver.exe");

	WebDriver driver = new ChromeDriver();
	
	log.info("launching browser");
	
	driver.get("http://www.google.com");
	
	log.info("browser launch");
	
	String title=driver.getTitle();
	
	log.info("title is"+title);
	
	if(title.equals("Googel"))
	{
		log.info("title is correct");
	}
	
	else {
		log.info("title is not correct");
	}
		
	
	driver.quit();
	
	log.info("browser is closed");
	
	
		}
	

}
<file_sep>package com.cookies;

import java.util.Iterator;
import java.util.Set;

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

public class cookiesDemo {
	@Test
	
	public void demo() {
		
		System.setProperty("webdriver.chrome.driver", "E:\\softwae\\chromedriver_win32\\chromedriver.exe");

		WebDriver driver = new ChromeDriver();
		
		driver.get("https://www.flipkart.com/");
		
		driver.manage().window().maximize();
		
		Set<Cookie> cook=driver.manage().getCookies();
		
		Cookie coo=new Cookie("uname", "kiran");
		
		
		driver.manage().getCookieNamed("coo");
		
	
		for(Cookie cooki:cook)
		{
			System.out.println("Cookies details");
			
			System.out.println("cookies name" +cooki.getName());
			
			System.out.println("cookies name" +cooki.getValue());
			
			System.out.println("cookies name" +cooki.getDomain());
			
			System.out.println("cookies name" +cooki.getPath());
			
			System.out.println("cookies name" +cooki.getClass());
			
			System.out.println("cookies name" +cooki.getExpiry());
		}

		driver.close();
	}
	

}
