Firefox实例未使用selenium打开
我尝试使用selenium驱动程序打开Firefox实例,但它显示了一些错误,有时浏览器会打开,但指定的URL没有打印到地址栏 这是我写的代码 包com.samaritan.automationFirefox实例未使用selenium打开,firefox,selenium,Firefox,Selenium,我尝试使用selenium驱动程序打开Firefox实例,但它显示了一些错误,有时浏览器会打开,但指定的URL没有打印到地址栏 这是我写的代码 包com.samaritan.automation import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.concurrent.TimeUnit; import org.openqa.selenium.
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
//import org.openqa.selenium.support.ui.ExpectedCondition;
class CommonFunctions
{
public void click()
{
try
{
String data;
BufferedReader br = new BufferedReader(new FileReader("D:/eRecruiters/_Recruiters - Copy.properties"));
while((data = br.readLine()) != null)
{
String[] strArr = data.split("\t");
String url =new StringBuffer(strArr[1]).append(strArr[0]).toString();
System.out.println(url);
FirefoxDriver driver = new FirefoxDriver();
driver.get(url + "/");
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.quit();
}
}
catch(IOException e) {
System.out.println("File not fould !");
}
}
}
有人能指出我遗漏了什么吗?
我已经在我的机器22.0上安装了最新的selenium jar文件和Firefox
这就是问题所在吗?或者代码中有问题吗?什么版本的Selenium?其他浏览器呢?Selenium-java-2.34.0和Selenium-server-standalone-2.25.0,我还没有在任何其他浏览器上尝试过。服务器也在v2.34上,请升级:我也尝试过,但也不起作用。。!!45000毫秒后,它无法连接到端口7055上的主机127.0.0.1。Firefox控制台输出:**LOG addons.manager:应用程序已升级,然后它开始更新firefox@Yougandhara你能分享你正在使用的firefox版本吗。代码在我这边运行良好。请检查selenium单机版和firefox版本的兼容性。