LambdaTest Community

Find answers, support, and inspiration from other users

LambdaTest Community

How can I run Selenium tests in multiple browsers?

Can anyone please provide me some knowledge regarding how i can run selenium tests in multiple browsers.

Up Vote Down Vote 0 Votes
Posted 4 months ago


We have multiple browsers for automation testing using selenium webdriver like Google Chrome, Mozilla Firefox, IE, HTML Unitdriver.

Here you can use all the above mentioned webdrivers as Headed drivers as well as Headless drivers.

For multiple browsers you can go through the below script

WebDriver driver;



public void setup(String browser) throws Exception{


System.setProperty("", ".\\geckodriver.exe");

driver = new FirefoxDriver();


else if(browser.equalsIgnoreCase("chrome")){


driver = new ChromeDriver();


else if(browser.equalsIgnoreCase("Edge")){


driver = new EdgeDriver();



throw new Exception("Browser is not correct");


driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);



public static void(){

*********you can write your script here.**********

Up Vote Down Vote 0 Votes
Posted 3 months ago