All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.seleniumtests.driver.WebUIDriverFactory Maven / Gradle / Ivy

There is a newer version: 4.23.18
Show newest version
package com.seleniumtests.driver;

import java.util.HashMap;

import com.seleniumtests.core.SeleniumTestsContextManager;

public class WebUIDriverFactory {
	
	private WebUIDriverFactory() {
		// nothing
	}

	public static WebUIDriver getInstance(String name) {
		WebUIDriver uiDriver = new WebUIDriver(name);
		uiDriver.setConfig(new DriverConfig(SeleniumTestsContextManager.getThreadContext()));
		
		if (WebUIDriver.getUxDriverSession().get() == null) {
			WebUIDriver.getUxDriverSession().set(new HashMap<>());
        }
		WebUIDriver.getUxDriverSession().get().put(name, uiDriver);
        
		WebUIDriver.switchToDriver(name);
		
		return uiDriver;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy