@BeforeMethod(alwaysRun = true)
	public void setUp(Method method) throws IOException, InterruptedException {

		Runtime runtime = Runtime.getRuntime();
		runtime.exec("java -jar V:\\testing\\selenium-java-2.40.0\\selenium-2.40.0\\selenium-server-standalone-2.33.0.jar -role hub");
		System.out.println("==================Server started=================");
		Thread.sleep(2000);

		Runtime runtime2 = Runtime.getRuntime();
		runtime2.exec("java -jar V:\\testing\\selenium-java-2.40.0\\selenium-2.40.0\\selenium-server-standalone-2.33.0.jar -role node -port 5554");
		System.out
				.println("=======================Node started====================");
		Thread.sleep(2000);

		currentTest = method.getName(); // get Name of current test.

		URL remote_grid = new URL("http://" + seleniumHub + ":"
				+ seleniumHubPort + "/wd/hub");

		String SCREENSHOT_FOLDER_NAME = "screenshots";
		String TESTDATA_FOLDER_NAME = "test_data";

		test_data_folder_path = new File(TESTDATA_FOLDER_NAME)
				.getAbsolutePath();
		screenshot_folder_path = new File(SCREENSHOT_FOLDER_NAME)
				.getAbsolutePath();

		DesiredCapabilities capability = null;
		if (targetBrowser == null || targetBrowser.contains("firefox")) {

			FirefoxProfile profile = new FirefoxProfile();

			profile.setPreference("dom.max_chrome_script_run_time", "999");
			profile.setPreference("dom.max_script_run_time", "999");
			profile.setPreference("browser.download.folderList", 2);
			profile.setPreference("browser.download.useDownloadDir", true);
			profile.setPreference("browser.download.manager.showWhenStarting",
					false);
			profile.setEnableNativeEvents(true);
			profile.setPreference("network.http.use-cache", false);

			capability = DesiredCapabilities.firefox();
			capability.setJavascriptEnabled(true);
			capability.setCapability(FirefoxDriver.PROFILE, profile);
			System.out.println("=========firefox browser===========");
		} else if (targetBrowser.contains("ie8")) {

			capability = DesiredCapabilities.internetExplorer();
			capability.setPlatform(Platform.ANY);
			capability.setBrowserName("internet explorer");
			// capability.setVersion("8.0");
			capability
					.setCapability(
							InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
							true);
			capability.setCapability(
					CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION,
					true);
			capability.setJavascriptEnabled(true);
		} else if (targetBrowser.contains("chrome")) {

			capability = DesiredCapabilities.chrome();
			System.setProperty("webdriver.chrome.driver",
					"V:\\testing\\chromedriver_win32\\chromedriver.exe");
			/*
			 * driver = new RemoteWebDriver(new
			 * URL("http://localhost:4444/wd/hub"), capability);
			 */

			capability.setBrowserName("chrome");
			capability.setJavascriptEnabled(true);

			this.driver = new ChromeDriver(capability);

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

		} else if (targetBrowser.contains("ie9")) {
			capability = DesiredCapabilities.internetExplorer();
			capability.setBrowserName("internet explorer");
			capability
					.setCapability(
							InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
							true);
			capability.setCapability(
					CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION,
					true);

			capability.setJavascriptEnabled(true);
			System.setProperty("webdriver.ie.driver",
					"V:\\testing\\IEDriverServer_x64_2.41.0\\IEDriverServer.exe");

			/*
			 * System.setProperty("webdriver.ie.driver",
			 * "V:\\testing\\IEDriverServer_Win32_2.41.0\\IEDriverServer.exe");
			 */
			this.driver = new InternetExplorerDriver(capability);

		} else if (targetBrowser.contains("safari")) {

			// System.setProperty("webdriver.safari.driver","/Users/jesus/Desktop/SafariDriver.safariextz");
			// driver = new SafariDriver();
			SafariDriver profile = new SafariDriver();

			capability = DesiredCapabilities.safari();

			capability.setJavascriptEnabled(true);
			capability.setBrowserName("safari");
			// //capability.setCapability(SafariDriver.CLEAN_SESSION_CAPABILITY,
			// profile);
			this.driver = new SafariDriver(capability);
		}
		/*System.out.println(remote_grid);*/
		driver = new RemoteWebDriver(remote_grid, capability);

		this.driver.get(testUrl);
		driver.manage().window().maximize();
		indexpage = new IndexPage(driver);

	}