I am beginning with selenium WebDriver, I want to make an independente copy of my WebDriver, I try to use the interface Cloneable but I could not because the class WebDriver doesn't implements the interface Cloneable.
I also try to create a class containing an attribute WebDriver like that
public class A implemnts Cloneable{
private WebDriver driver;
public A(WebDriver driver){
this.driver = driver;
}
public WebDriver clone throws CloneNotSupportedException {
A mClass = (A) super.clone();
return mClass.driver;
}
}
WebDriver driver = new A().clone();
but it does not work well ... Does anyone know how I can do this ???