Faz*_*azy 0 java firefox selenium webdriver
嗨我有我当前框架的设置,
ClassA
{
//Which Receives Selenium WebDriver call the 'driver' object reference to manipulate the locators in UI
public WebDriver get()
{
return MainClass.driver;
}
}
MainClass
{
public static Webdriver driver;
method A()
{
//which uses Firefox instance and it is passed to ClassA to operate
driver = new FirefoxDriver();
}
methodB()
{
//which creates new instance of Chrome
driver = new ChromeDriver();
}
}
Run Code Online (Sandbox Code Playgroud)
我想要做的是,一旦我调用methodB()创建了Chrome的实例,但是一旦完成,我想恢复到在chrome运行之前可用或调用的firefox实例,但是我的方法是因为我指的是相同的webdriver对象旧的firefox引用被删除.
有什么建议 ?
PS:请原谅我遵循的错误代码约定
| 归档时间: |
|
| 查看次数: |
1637 次 |
| 最近记录: |