Sunday 17 May 2015

How to copy Emailable_Report for each instance in TestNg Framework



If we need to copy and paste for each instance then we need to add below code in our framework

We should add this code in @AfterTest Annotation section

 @AfterTest
  public void aftertest() throws IOException
  {
 driver1.close();
 Date dat1=new Date();
 SimpleDateFormat sdf=new SimpleDateFormat("ddMMyyy'_'hh.mm.ss");
 File Source1= new File(System.getProperty("user.dir")+"\\test-output\\emailable-report.html");
 String str=sdf.format(dat1);
 File Destination=new File(System.getProperty("user.dir")+"\\emailable-report_"+str+".html");
 FileUtils.copyFile(Source1, Destination);
 System.out.println(sdf.format(dat1));

  }

Saturday 16 May 2015

How to identify eclipse 32 bit or 64 bit installed in our system



Method 1

-> Open the task Manager

-> For 32 bit : Its run as eclipse.exe *32 in task manager

-> For 64 bit : Its run as eclipse.exe in task manager


Method 2

-> Verify eclips.ini file . Configuration Settings file in eclips installed folder.

-> Check the 4rd line,
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.0.v20100503

-> For 32 bit : Its contains only x86_1

-> For 64 bit : Its contains x86_64_1

Above line from 64 bit

How to identify jdk 32 bit or 64 bit installed our system



Method 1:

-> For 32 bit : jdk or jre installed in below location

C:\Program Files (x86)Java


-> For 64 bit : jdk or jre installed in below location

C:\Program Files\Java




Method 2

-> Open the task Manager

-> For 32 bit : Its run as javaw.exe *32 in task manager

-> For 64 bit : Its run as javaw.exe in task manager

Saturday 21 March 2015

Why we need IEDriver and ChromeDriver but not FirefoxDriver in Selenium WebDriver



-> This is because of "Native Browser approach" used in WebDriver.

-> Each and every browser have different JS Engine.

-> Selenium offers inbuilt driver based on Firefox JS Engine. So rest of browser (like IE,Chrome) requires respective drivers for each browser.

-> Chrome Driver have built based on Chrome driver JS Engine.

-> IE Driver have built based on IE driver JS Engine.

So like wise all browser need respective driver for run in selenium webdriver