<file_sep>apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'project-report'

sourceCompatibility = 1.7
targetCompatibility = 1.7
version = '1.0'

jar {
    manifest {
        attributes 'Implementation-Title': 'Gradle Quickstart',
                   'Implementation-Version': version
    }
}

repositories {
    mavenCentral()
}

dependencies {
    compile(
        ['commons-collections:commons-collections:3.2'],
        ['org.seleniumhq.selenium:selenium-java:2.53.0'],
        ['org.apache.logging.log4j:log4j-core:2.1'],
        ['dom4j:dom4j:1.6.1'],
        ['org.apache.commons:commons-csv:1.2'],
        ['commons-net:commons-net:1.4.1'],
        ['com.google.inject:guice:4.0'],
        [files('libs/javacsv.jar', 'libs/reportng-1.1.4.jar','libs/velocity-dep-1.4.jar')],
    	['org.testng:testng:6.9.10']
    )

}

defaultTasks 'test', 'clean', 'compileJava'

test {
     useTestNG(){
     	options.suites(file('config/TestNG_configs/TestBaseConfig_4comps.xml'));
     	useDefaultListeners = false
     }
}

task copyJars(type:Copy){  
    from configurations.runtime 
    into 'libs'
}

compileJava {
	fileTree(dir: 'libs', include: ['*.jar']) 
}

uploadArchives {
    repositories {
       flatDir {
           dirs 'repos'
       }
    }
}
<file_sep>package com.trane.display.utils;
/**
 * This class is to designed to interpret UI Map xml
 * 
 * @author irblir
 * @since 2016-04-22
 */
public class Locator 
{
	private String selector;
	public enum ByType 
	{
		xpath, id, linkText, name, className, cssSelector, partialLinkText, tagName
	}

	private ByType byType;

	public Locator() 
	{

	}

	/**
	 * default Locator - id
	 */
	public Locator(String selector) 
	{
		this.selector = selector;
		this.byType = ByType.id;
	}

	public Locator(String selector, ByType byType) 
	{
		this.selector = selector;
		this.byType = byType;
	}

	public String getSelector() 
	{
		return selector;
	}

	public ByType getBy() 
	{
		return byType;
	}

	public void setBy(ByType byType) 
	{
		this.byType = byType;
	}

}
<file_sep>package com.trane.display.utils;

import java.nio.charset.Charset;
import java.util.HashMap;

import com.csvreader.CsvReader;
import com.csvreader.CsvWriter;

public class CSVutils 
{
	
	public static HashMap<String, String> readCSV(String localDirAndFileName, Integer pageIndex) throws Exception 
	{
		Log log = new Log(CSVutils.class);
		
		HashMap<String, String> dataMap = new HashMap<String, String>();
		dataMap.clear();
		
        CsvReader reader = new CsvReader(localDirAndFileName, ',',Charset.forName("UTF-8"));
        reader.readHeaders();
        while (reader.readRecord()) 
        {

            String selector = reader.get("id");
            String varName = reader.get("varName");
            String index = reader.get("pageIndex");

        	if(reader.get("pageIndex").equalsIgnoreCase(pageIndex+"")) 
        	{
                log.info(index + "," + selector + "," + varName);
            	dataMap.put(selector, varName);
            } else 
            {
            	continue;
            }
        	
        }
        reader.close();
        return dataMap;
	}
	/**
	 * create a CSV template
	 * @param filename
	 * @throws Exception
	 */
	public static void writeCSV(String filename) throws Exception 
	{
		String path = System.getProperty("user.dir") 
				+ "\\src\\main\\java\\com\\trane\\display\\cases\\data\\" 
				+ filename;
		
		CsvWriter writer = new CsvWriter(path, ',', Charset.forName("UTF-8"));
		String[] contents = {"pageIndex","id","varName"};
		writer.writeRecord(contents);
		writer.close();
	}

}
<file_sep>package com.trane.display.cases;


import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class ExampleTest {

	public static void main(String[] args) throws Exception {
		WebDriver driver = new FirefoxDriver();

		driver.get("http://1172.16.17.32/FS/root/UI_Medium/index.html");
		
		WebDriverWait wait = new WebDriverWait(driver, 10);
		wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("idLbl_pgHomePage_Title"), "Home"));
		
//		WebElement e = driver.findElement(By.xpath("//*[text()='Reports']"));
		WebElement e = driver.findElement(By.id("idBtn_pgMain_navfooterBtnReports"));
		if (e.isDisplayed()) {

			System.out.println("getAttribute(): " + e.getAttribute("class")); // navfooter_btn_off
			System.out.println("getText: " + e.getText()); // Reports
			System.out.println("getLocation: " + e.getLocation()); // (218, 426)
			System.out.println("getSize: " + e.getSize()); // (180, 50)

			e.click();

			System.out.println("..................................");

			System.out.println("getAttribute(): " + e.getAttribute("class")); // navfooter_btn_on
			System.out.println("getText: " + e.getText()); // Reports
			System.out.println("getLocation: " + e.getLocation()); // (218, 426)
			System.out.println("getSize: " + e.getSize()); // (180, 50)
			
            Thread.sleep(3000);
			WebElement el = driver.findElement(By.xpath("//*[text()='Log Sheet']"));
//            WebElement el = driver.findElement(By.id("idLbl_pgReportsLanding_r3c3"));
			el.click();
			
			Thread.sleep(3000);
			System.out.println("...........................................");
			System.out.println(driver.findElement(By.id("idLbl_pgStandardReport_Title")).getText());
			System.out.println(driver.findElement(By.id("idLbl_pgStandardReport_SubTitle")).getText());
//			Assert.assertEquals(driver.findElement(By.id("idLbl_pgStandardReport_Title")).getText(), "Log Sheet");
//			Assert.assertEquals(driver.findElement(By.id("idLbl_pgStandardReport_SubTitle")).getText(), "Evaporator");

			driver.close();
		}
	}

}
<file_sep>package com.trane.display.cases;

import com.trane.display.utils.FTPutils;

public class Main {

	public static void main(String[] args) throws Exception {
		Main test = new Main();
	}


}
<file_sep>package com.trane.display.cases;



import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;

import com.trane.display.utils.BaseActions;
import com.trane.display.utils.TestNGListener;

@Listeners({TestNGListener.class })
public class TestBaseConfig_4comps extends BaseActions
{
//	private String localRequiredDevices = "UC800 - RTAF - Comp4 - BASE - RequiredDevices";
//	private String localConfigurationRecord = "UC800 - RTAF - Comp4 - BASE - ConfigurationRecord";
//	private String localNameplateRecord = "UC800 - RTAF - Comp4 - BASE - NameplateRecord";
//	private String localQuestionRecord = "UC800 - RTAF - Comp4 - BASE - QuestionRecord";
	
//	@BeforeClass
//	public void configure() throws Exception 
//	{
//		configFTPfiles(localRequiredDevices, localConfigurationRecord, localNameplateRecord, localQuestionRecord);
//		openHomePage();
//	}
	
	@Test(description = "Navigate to Service Settings page")
	public void a_navigateToServiceSettingsPage() throws Exception 
	{
//		configFTPfiles("localRequiredDevices", "localConfigurationRecord", "localNameplateRecord", "localQuestionRecord");
		openHomePage();
		clickVisibleDiv("Settings");
		clickVisibleDiv("Chiller Settings");
		clickVisibleDiv("Service Settings");
		clickVisibleDiv("OK");
		verifyText("Title", "Service Settings");
	}
	
	@Test(description = "Verify Service Settings Data")
	public void b_verifyServiceSettingsData() throws Exception 
	{
		verifyAllData("RTAFComp4GlycolServiceSettings");
	}
	
//	@Test(description = "Navigate to Edit Custom Report page")
//	public void c_navigateToEditCustomReportPage() throws Exception 
//	{
//		clickVisibleDiv("Reports");
//		clickVisibleDiv("Custom Report 1");
//		clickVisibleDiv("Edit");
//		verifyText("Title", "Edit Custom Report");
//		verifyText("SubTitle", "Custom Report 1");
//	}
//	
//	@Test(description = "Verify Custom Report Data")
//	public void d_verifyCustomReportData() throws Exception 
//	{
//		verifyAllCustomReportData("BaseConfigCustomReport");
//	}
	
//	@Test(description = "Navigate to Log Sheet page")
//	public void e_navigateToLogSheetPage() throws Exception 
//	{
//		clickVisibleDiv("Reports");
//		clickVisibleDiv("Log Sheet");
//		verifyText("Title", "Log Sheet");
//		verifyText("SubTitle", "Evaporator");
//	}
//	
//	@Test(description = "Verify Log Sheet Data")
//	public void f_verifyLogSheetData() throws Exception 
//	{
//		verifyAllData("BaseConfigLogSheet");
//	}
	
//	@Test(description = "Navigate to Evaporator Circuit 1 page")
//	public void g_navigateToEvapCkt1Page() throws Exception 
//	{
//		clickVisibleDiv("Reports");
//		clickVisibleDiv("Evaporator");
//		clickVisibleDiv("Circuit 1");
//		verifyText("Title", "Evaporator");
//		verifyText("SubTitle", "Circuit 1");
//	}
//	
//	@Test(description = "Verify Data")
//	public void h_verifyEvapCkt1Data() throws Exception 
//	{
//		verifyAllData("BaseConfigEvap_Ckt1");
//	}
	
	@AfterClass(description = "Close FireFox")
	public void tearDown() 
	{
		closeFirefox();
	}
	
	

}
<file_sep>package com.trane.display.utils;

/**
 * This class is designed to update configuration files.
 * 
 * @author irblir
 * @since 2016-04-22
 */

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.SocketException;

import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPReply;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class FTPutils 
{
	
	 private static FTPClient ftpClient = new FTPClient();
	 private static Log log = new Log(FTPutils.class);
	 
	 public static boolean connectFTP() 
	 {
		 boolean result = false;
		 String ip = "192.168.1.3";
		 String username = "root";
		 String password = "<PASSWORD>";

         try 
         {
        	 
			int reply;
			ftpClient.connect(ip);
			ftpClient.login(username, password);

			reply = ftpClient.getReplyCode();
			if (!FTPReply.isPositiveCompletion(reply)) 
			{
				log.error("Connect failed");
				ftpClient.disconnect();
				return result;
			}
			
	         result = true;
	         log.info("Connect to the Server successfully");
		         
		} catch (SocketException e) 
         {
			e.printStackTrace();
		} catch (IOException e) 
         {
			e.printStackTrace();
		}
		 
		 return result;
		 
	 }

	 public static boolean uploadFile(String localDirAndFileName, String ftpDirAndFileName) throws Exception 
	 {
	        boolean result = false;
	        
         	int separator = ftpDirAndFileName.lastIndexOf("/");
         	String ftpDir = ftpDirAndFileName.substring(0, separator+1);
         	String ftpfilename = ftpDirAndFileName.substring(separator+1);
         	log.info("uploadFile method: ftpDirectory: " + ftpDir);
         	log.info("uploadFile method: ftpfilename: " + ftpfilename);
	        
	        if(!ftpClient.isConnected()) 
	        {
	        	log.info("uploadFile method: the connection is lost!");
	        	return false;
	        }
	
        		 boolean changeDir = ftpClient.changeWorkingDirectory(ftpDir);
        		 log.info("changeDir: "+changeDir);
        		 FileInputStream fis = new FileInputStream(new File(localDirAndFileName));

 	            if (changeDir) 
 	            {

 	            	ftpClient.setControlEncoding("utf-8");
 	            	ftpClient.setBufferSize(1024);
 	            	ftpClient.setFileType(FTPClient.BINARY_FILE_TYPE);
 	            	ftpClient.enterLocalPassiveMode();
 	            	
 	                result = ftpClient.storeFile(new String(ftpfilename.getBytes()), fis);
 	            	
 	                if (result) 
 	                {
 	                    log.info("upload " + localDirAndFileName +" Successfully to "+ ftpDir + ftpfilename);
 	                } else if(!result) 
 	                      {
 	                		log.error("fail to upload " + localDirAndFileName +" to "+ ftpDir + ftpfilename);
 	                	  }
 	            } else if(!changeDir) 
 	                  {
 	            		log.error("fail to change Directory.");
 	            	  }
 	            fis.close();
	           
	        
	        return result;
	    }
	 
	 public static boolean deleteFile(String ftpDirAndFileName) 
	 {
	        boolean result = false;
         	log.info("deleteFile method: ftpDirAndFileName: " + ftpDirAndFileName);
	        
	        if(!ftpClient.isConnected()) 
	        {
	        	log.info("deleteFile method: the connection is lost!");
	        	return false;
	        }
	
	        try 
	        {
	        		result = ftpClient.deleteFile(ftpDirAndFileName);
	        		if (result) 
	        		{
	        			log.info("delete " + ftpDirAndFileName + " Successfully");
	        		} else if(!result) 
	        		      {
	        				log.info("deleteFile method: do nothing here. Maybe " + ftpDirAndFileName + " doesn't exist.");
	        			  }
	        } catch (IOException e) 
	        {
	            e.printStackTrace();
	        }
	        return result;
		 
	 }

	 
	 public static void closeFTP() 
	 {
		 if (ftpClient != null && ftpClient.isConnected()) 
		 {
			 try 
			 {
				ftpClient.disconnect();
			} catch (IOException e) 
			 {
				e.printStackTrace();
			}
			 log.info("Close Server Successfully!");

         }
	 }
}<file_sep>#!/usr/bin/python
# UC800_reset.py

import sys, httplib

errCode = 0

httpConn = httplib.HTTPConnection('192.168.1.3', 80)

httpConn.request('POST', '/evox/hardware/reset', '<int val="60878720"/>')
httpResp = httpConn.getresponse()
if (httpResp.status != 200 or httpResp.read().find('<err') >= 0):
    errCode = 1

httpConn.close()
sys.exit(errCode)
<file_sep>package com.trane.display.utils;

import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;

import org.apache.commons.io.FileUtils;
import org.openqa.selenium.By;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;

public class BaseActions 
{
	
	public WebDriver driver = new FirefoxDriver();
	public HashMap<String, Locator> locatorMap;
	public Log log = new Log(this.getClass());
	public String localDirAndFileName;
	public HashMap<String, String> dataMap;
	
	/**
	 * read xml to inital UI locator map
	 * @throws Exception
	 */
	public void InitLocatorMap() throws Exception 
	{
		localDirAndFileName = System.getProperty("user.dir") 
				+ "\\src\\main\\java\\com\\trane\\display\\UIMaps\\" 
				+ "UIMap.xml";
		log.info(localDirAndFileName);
		locatorMap = XMLutils.readXMLDocument(localDirAndFileName);
	}
	
	public void VerifyData(String filename, Integer pageIndex) throws Exception 
	{
		localDirAndFileName = System.getProperty("user.dir") 
				+ "\\src\\main\\java\\com\\trane\\display\\cases\\data\\" 
				+ filename
				+ ".csv";
		dataMap = CSVutils.readCSV(localDirAndFileName, pageIndex);
		log.info(localDirAndFileName);
		  
		  if(!dataMap.isEmpty()) 
		  {
				Set<String> keys = dataMap.keySet();
				
				Iterator<String> iter = keys.iterator();
				  
				  while(iter.hasNext()) 
				  {
				      String key = (String)iter.next();
				      String value = (String)dataMap.get(key);
				      
				      if(!ElementExist(By.id(key))) 
				      {
				    	  log.info("This WebElement doesn't exist!" );
				    	  Assert.assertEquals("Blank", value);
				    	  
				    	  if(value.equalsIgnoreCase("Blank")) 
				    	  {
					    	  log.info("Pass! ");
					    	  log.info("Expected value: " + value);
				    	  } else if(!value.equalsIgnoreCase("Blank")) 
				    	  		{
						    	  log.error("Fail! ");
						    	  log.info("Expected value: " + value);
				    	  		}

				      } else if (ElementExist(By.id(key))) 
				      		{
				    		  WebElement e = driver.findElement(By.id(key));
				    		  String actualValue = e.getText();

				    		   Assert.assertEquals(actualValue, value);

					    		  if (actualValue.equalsIgnoreCase(value)) 
					    		  {
					    			  log.info("Pass! ");
					    			  log.info("Actual value: " + actualValue);
					    			  log.info("Expected value: " + value);
					    		  } else if (!actualValue.equalsIgnoreCase(value)) 
					    		  		{
						    			  log.error("Fail! ");
						    			  log.info("Actual value: " + actualValue);
						    			  log.info("Expected value: " + value);
					    		  		}
				    		  }
				      }
			} else 
			{
			  log.error("dataMap is empty!!!");
		    }
	}
	
	public void replaceFTPfile(String localfilename, String ftpDirAndFileName) throws Exception 
	{
		localDirAndFileName = System.getProperty("user.dir") 
				+ "\\src\\main\\java\\com\\trane\\display\\cases\\data\\UC Configs\\" 
				+ localfilename
				+ ".xml";

		FTPutils.deleteFile(ftpDirAndFileName);
		FTPutils.uploadFile(localDirAndFileName, ftpDirAndFileName);
	
	}
	
	public void configFTPfiles(String localRequiredDevices, String localConfigurationRecord, String localNameplateRecord, String localQuestionRecord) throws Exception 
	{
		FTPutils.connectFTP();
		
		log.info("configure RequiredDevices......");
		replaceFTPfile(localRequiredDevices, "/FW_IPC3DeviceBinding/RequiredDevices.xml");
		
		log.info("configure ConfigurationRecord......");
		replaceFTPfile(localConfigurationRecord, "/Configuration/ConfigurationRecord.xml");
		
		log.info("configure NameplateRecord......");
		replaceFTPfile(localNameplateRecord, "/Configuration/NameplateRecord.xml");
		
		log.info("configure QuestionRecord......");
		replaceFTPfile(localQuestionRecord, "/Configuration/QuestionRecord.xml");

		FTPutils.closeFTP();
		rebootMP();
		
	}
	
	public void rebootMP() 
	{
		String path = System.getProperty("user.dir") 
				+ "\\src\\main\\java\\com\\trane\\display\\cases\\data\\" 
				+ "UC800_reset.py";
		 try {  
	             log.info("start to reboot MP.........");
	             Process pr = Runtime.getRuntime().exec("python " + path);  
	             pr.waitFor();
	             log.info("wait 90 seconds to wait for reboot successfully......");
	             Thread.sleep(90000);
	             log.info("reboot MP successfully");
             } catch (Exception e) 
		 	  {  
                 e.printStackTrace();  
              }  
	}
	
	public WebDriver getDriver() 
	{
		return driver;
	}
    /**
     * load home page
     */
    public void openHomePage() 
    {
    	driver.get("http://192.168.1.3/FS/root/UI_Medium/index.html");  
    	WebDriverWait wait = new WebDriverWait(driver,20); 
    	wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("idLbl_pgHomePage_Title"), "Home"));
        log.info("Home Page is loaded successfully");
    }
    
    public void takeScreenShot() 
    {
		
		SimpleDateFormat sf = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss");
		Calendar cal = Calendar.getInstance();
		Date date = cal.getTime();
		String dateStr = sf.format(date);
		
		String localDirAndFileName = System.getProperty("user.dir") 
				+ "\\screenshots\\" 
				+ dateStr
				+ ".png";
		
		File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
		
		try 
		{
			log.info("saved screenshot is:" + localDirAndFileName);
			FileUtils.copyFile(scrFile, new File(localDirAndFileName));
		} catch (Exception e) 
		  {
			log.error("Can't save screenshot");
			e.printStackTrace();
		  } finally 
		    {
			 log.info("screen shot finished");
		    }
	}
    
    /**
     * 
     * @param locatorName
     * @return
     * @throws Exception
     */
    public boolean isElementPresent(String locatorName) throws Exception 
    {
    	Locator locator = getLocator(locatorName);
    	boolean isPresent = false;
    	WebDriverWait wait = new WebDriverWait(driver, 10);
    	isPresent = wait.until(ExpectedConditions.presenceOfElementLocated(getByLocator(locator))).isDisplayed();
    	return isPresent;
    	
    }
    
	boolean ElementExist(By Locator) 
	{
		try 
		{
			driver.findElement(Locator);
			return true;
		} catch (org.openqa.selenium.NoSuchElementException ex) 
		{
			return false;
		}
	}
    
	/**
	 * 
	 * @param locatorName
	 * @return
	 * @throws IOException
	 */
	public Locator getLocator(String locatorName) throws IOException 
	{
		Locator locator = locatorMap.get(locatorName);
		return locator;

	}
	/**
	 * 
	 * @param locatorName
	 * @return
	 * @throws Exception
	 */
	public WebElement getElement(String locatorName) throws Exception 
	{
		Locator locator = getLocator(locatorName);
		By by = getByLocator(locator);
		WebElement element = driver.findElement(by);
		return element;
	}
	/**
	 * click and find a WebElement by locatorName
	 * @param locatorName
	 * @throws Exception
	 */
	public void click(String locatorName) throws Exception 
	{
		WebElement e = getElement(locatorName);
		log.info("click "+locatorName);
		e.click();
		Thread.sleep(3000);
	}
	/**
	 * 
	 * @param locator
	 * @return By
	 * @throws IOException
	 */
	public By getByLocator(Locator locator) throws IOException 
	{
		By by = null;
		String selector = locator.getSelector();
		switch (locator.getBy()) 
		{
			case xpath:
				log.debug("find element By xpath:"+selector);
				by = By.xpath(selector);
				break;
			case id:
				log.debug("find element By id:"+selector);
				by = By.id(selector);
				break;
			case name:
				log.debug("find element By name:"+selector);
				by = By.name(selector);
				break;
			case cssSelector:
				log.debug("find element By cssSelector:"+selector);
				by = By.cssSelector(selector);
				break;
			case className:
				log.debug("find element By className:"+selector);
				by = By.className(selector);
				break;
			case tagName:
				log.debug("find element By tagName:"+selector);
				by = By.tagName(selector);
				break;
			case linkText:
				log.debug("find element By linkText:"+selector);
				by = By.linkText(selector);
				break;
			case partialLinkText:
				log.debug("find element By partialLinkText:"+selector);
				by = By.partialLinkText(selector);
				break;
		}
		return by;
	}
	/**
	 * 
	 * @param locatorName
	 * @param num
	 * @throws Exception
	 */
	public void verifyText(String locatorName, Integer num) throws Exception 
	{
		Thread.sleep(3000);
		Assert.assertEquals(getElement(locatorName).getText(), num+"");
		
	}
	/**
	 * 
	 * @param locatorName
	 * @param text
	 * @throws Exception
	 */
	public void verifyText(String locatorName, String text) throws Exception 
	{
		Thread.sleep(3000);
		Assert.assertEquals(getElement(locatorName).getText(), text);
		
	}
	/**
	 * 
	 * @param locatorName
	 * @param attribute
	 * @param content
	 * @throws Exception
	 */
	public void verifyAttribute(String locatorName, String attribute, String content) throws Exception 
	{
		Thread.sleep(3000);
		Assert.assertEquals(getElement(locatorName).getAttribute(attribute), content);
	}
	
	/**
	 * find and click a WebElemnt by Text 
	 * @param WebElemnt's Text
	 */
	public void clickVisibleDiv(String text) 
	{
		driver.findElement(By.xpath("//*[text()='"+text+"']")).click();
		try 
		{
			Thread.sleep(3000);
		} catch (InterruptedException e) 
		{
			e.printStackTrace();
		}
	}
	
	public void closeFirefox()
	{
		driver.close();
	}
	


}
<file_sep>package com.trane.display.cases;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

import com.trane.display.pages.HomePage;

public class TestPageObjects {

	public static void main(String[] args) throws Exception {
		WebDriver driver = new FirefoxDriver();

		driver.get("http://192.168.1.3/FS/root/UI_Medium/index.html");
//    	driver.manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS);
		
		WebDriverWait wait = new WebDriverWait(driver, 10);
		wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("idLbl_pgHomePage_Title"), "Home"));
		
		HomePage homePage = new HomePage(driver);
		PageFactory.initElements(driver, HomePage.class);
		System.out.println(homePage);
		
		homePage.NavigateToReportsPage().NavigateToLogSheetPage();
		driver.quit();
		


	}

}
<file_sep>package com.trane.display.utils;

import java.io.FileInputStream;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.config.ConfigurationSource;
import org.apache.logging.log4j.core.config.Configurator;

public class Log {
	private final Class<?> clazz;
	private static Logger logger;

    public Log(Class<?> clazz) 
    {
		this.clazz = clazz;
		logger = LogManager.getLogger(this.clazz);
	}
	
//	trace < debug < info < warn < error < fatal

	public void info(String message) 
	{
		logger.info(clazz.getCanonicalName() + ": " + message);
	}

	public void debug(String message) 
	{
		logger.debug(clazz.getCanonicalName() + ": " + message);
	}


	public void error(String message) 
	{
		logger.error(clazz.getCanonicalName() + ": " + message);
	}


	public void trace(String message) 
	{
		logger.trace(clazz.getCanonicalName() + ": " + message);
	}


	public void warn(String message) 
	{
		logger.warn(clazz.getCanonicalName() + ": " + message);
	}


	public void fatal(String message) 
	{
		logger.fatal(clazz.getCanonicalName() + ": " + message);
	}
	
	public static void initalConfigSrc(){
		
	    ConfigurationSource source;
	    try {
	      
	      String config=System.getProperty("user.dir");
	      source = new ConfigurationSource(new FileInputStream(config+"\\log4j2.xml"));
	      Configurator.initialize(null, source);
	      
	    } catch (Exception e) {
	      e.printStackTrace();
	    }
	  }
	  
	
}
<file_sep>package com.trane.display.cases;

import org.testng.annotations.BeforeClass;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;

import com.trane.display.utils.BaseActions;
import com.trane.display.utils.TestNGListener;

@Listeners({TestNGListener.class })
public class TestLogSheet extends BaseActions
{
	private String btn_Reports = "btn_Reports";
	private String title_Reports = "title_Reports";
	private String StandardReport_Title = "StandardReport_Title";
	private String StandardReport_SubTitle = "StandardReport_SubTitle";
	private String page_num = "page_num";
	private String total_page_num = "total_page_num";
	
	private String localRequiredDevices = "UC800 - RTAF - Comp2 - BASE - RequiredDevices";
	private String localConfigurationRecord = "UC800 - RTAF - Comp2 - BASE - ConfigurationRecord";
	private String localNameplateRecord = "UC800 - RTAF - Comp2 - BASE - NameplateRecord";
	private String localQuestionRecord = "UC800 - RTAF - Comp2 - BASE - QuestionRecord";
	
	@BeforeClass
	public void configure() throws Exception 
	{
		configFTPfiles(localRequiredDevices, localConfigurationRecord, localNameplateRecord, localQuestionRecord);
		InitLocatorMap();
		openHomePage();
	}
	
	@Test(description = "Click Reports button on the navigate footer")
	public void clickReports() throws Exception 
	{
		verifyAttribute(btn_Reports, "class", "navfooter_btn_off");
		clickVisibleDiv("Reports");
	}
	
	@Test(description = "Verify Reports button pressed in and navigated to Reports page")
	public void verifyBtnReportsClicked() throws Exception 
	{
		verifyAttribute(btn_Reports, "class", "navfooter_btn_on");
		verifyText(title_Reports, "Reports");
	}

	@Test(description = "Click Log Sheet button on the Reports page")
	public void clickLogSheet() throws Exception 
	{
		clickVisibleDiv("Log Sheet");
	}
	
	@Test(description = "Verify on Log Sheet page 1")
	public void verifyBtnLogSheetClicked() throws Exception 
	{
		verifyText(StandardReport_Title, "Log Sheet");
		verifyText(StandardReport_SubTitle, "Evaporator");
		verifyText(page_num, 1);
		verifyText(total_page_num, 13);
	}
	
	@Test(description = "Verify Log Sheet Data")
	public void verifyLogSheetData() throws Exception 
	{
		VerifyData("BaseConfigLogSheet", 1);
		click("btn_Down");
		VerifyData("BaseConfigLogSheet", 2);
	}
	
	@Test(description = "Close FireFox")
	public void tearDown() 
	{
		closeFirefox();
	}
	
	

}
<file_sep><?xml version="1.0"?>
<project name="medium" default="run" basedir=".">
	<property name="bin" value="bin"/>
	<property name="src.dir" value="src/main/java" />
	<property name="build.dir" value="build"/>
	<property name="classes.dir" value="${build.dir}/classes" />
	<property name="test-results.dir" value="test-output" />
	
	<path id="run.classpath">
		<fileset dir="${basedir}">
			<include name="lib/poi/*.jar" />
			<include name="lib/poi/lib/*.jar" />
			<include name="lib/testng.jar" />
			<include name="lib/sikuli-script.jar" />
			<include name="lib/*.jar" />
		</fileset>
		<fileset dir="${basedir}/lib/selenium">
			<include name="*.jar" />
			<include name="libs/*.jar" />
		</fileset>
	</path>
	
	<taskdef name="testng" classname="org.testng.TestNGAntTask" classpathref="run.classpath" />
	
	<target name="clean">
		<delete dir="${build.dir}"/>
	</target>
	
	<target name="compile" depends="clean">
		<mkdir dir="${classes.dir}"/>
		<javac srcdir="${src.dir}" destdir="${classes.dir}" debug="on" encoding="UTF-8" includeantruntime = "false">
			<classpath refid="run.classpath"/>
		</javac>
	</target>
	
	<path id="runpath"> 
		 <path refid="run.classpath"/> 
		 <pathelement location="${classes.dir}"/> 
	</path> 
	
	<target name="run" depends="compile">
		<testng classpathref="runpath"  
				outputDir="${test-results.dir}" 
			    haltonfailure="true"
			    useDefaultListeners="false"   
			    listeners="org.uncommons.reportng.HTMLReporter,org.testng.reporters.FailedReporter" >  
			<xmlfileset dir="${basedir}" includes="TestLogSheet.xml"/>
			<jvmarg value="-Dfile.encoding=UTF-8" />
			<sysproperty key="org.uncommons.reportng.title" value="Automation TestReport" /> 
		</testng>
	</target>
	
	<target name="jar" depends="compile">
		<jar basedir="${bin}" destfile="${jar-file-name}">
			<zipfileset excludes="META-INF/*.SF"  />
		</jar>
	</target>
</project>