Posts

Showing posts from October, 2020

Parallel Execution In TestNG Framework Using ThreadLocal Concept

  Parallel Execution We can achieve parallel execution In TestNG Framework by implementing ThreadLocal Concept. We can execute the independent test methods in parallel resulting in reducing the test execution time. BrowserUtility.java This class file contains a methods named by "createDriverInstance" which returns the reference variable of WebDriver Type based on the browser type (chrome or firefox or IE or edge) provided in the parameter. package parallelExecution; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.edge.EdgeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxOptions; import org.openqa.selenium.ie.InternetExplorerDriver; import org.openqa.selenium.ie.InternetExplorerOptions; public class BrowserUtility { public static WebDriver createDriverInstance(String browserType ) { WebDriver driver = null ;...