Tag: firefox

使用Selenium 3.0启动Firefox 46.0.1时获取IllegalStateException

我有Selenium 3.0.1版和Firefox版46.0.1。 在selenium 3.0.1 changelog中提到: Geckodriver现在是自动化Firefox的默认机制。 这是Mozilla为该浏览器实现的驱动程序,并且是自动化Firefox 48及更高版本所必需的 虽然我收到错误: java.lang.IllegalStateException:驱动程序可执行文件的路径必须由webdriver.gecko.driver系统属性设置; 有关更多信息,请参阅https://github.com/mozilla/geckodriver 。 最新版本可以从https://github.com/mozilla/geckodriver/releases下载 执行以下代码时: @Test public void test() { WebDriver driver = new FirefoxDriver(); driver.get(“http://www.google.com”); driver.quit(); } 为什么我会收到此错误但是我使用的是Firefox版本<48.0? 是否必须将Geckodriver与Selenium 3.0.1一起使用? 如果我进行以下更改,上面的代码工作正常: System.setProperty(“webdriver.gecko.driver”,”path to geckodriver”); WebDriver driver = new FirefoxDriver();

像Firefox一样使用标题制作JPanel边框

我想在我的应用程序中创建一个选项对话框。 在这个对话框中,我想制作一些用边框和标题包围的区域。 我想要的一个例子是Firefox: 我怎样才能在Java中做类似的事情?

webdriver无法单击firefox中的超链接

package testproject; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; public class WeblinkTest { public static void main(String[] args) throws InterruptedException { // Creating a fierfox driver/window WebDriver driver= new FirefoxDriver(); //Assigning address of the webpage which you want to check driver.get(“https://www.google.co.in/”); Thread.sleep(2000); //Creating and Identifing–By.xpath the element on which you want testing WebElement wb1= […]

如何使用Geckodriver保留我的Firefox配置文件缓存?

我需要使用Selenium和Geckodriver保留我的缓存。 我有一个Firefox配置文件,我在启动Geckodriver时加载它: ProfilesIni profilesIni = new ProfilesIni(); FirefoxProfile firefoxProfile = profilesIni.getProfile(“profile-name”); firefoxOptions.setProfile(firefoxProfile); 这可以正常工作,但它不会复制缓存。 去about:cache ,它是空的。 我想保留我的缓存,我想直接使用我的个人资料。 目前, Selenium/Geckodriver复制部分配置文件并使用它,但不会使用缓存。 使用Geckodriver时如何保持缓存?

45000 ms后无法在端口7055上连接到主机127.0.0.1。 用FF版26.0和selenium独立jar2.39

我正在尝试连接到我的AWS unix机器上安装了FF版本26.0的selenium 2.30,但是当我启动访问selenium的客户端时,我遇到了以下错误。 此外,当我尝试与selenium独立jar 2.38.0相同时,它工作正常,但在一两天的一段时间后突然发生,它开始给出2.38.0以下的错误。 不知道为什么会这样? 任何的想法?? 项目是我有一个multithreading应用程序,其中客户端持续执行一些线程,ping一些URL和所有,它继续发生,除非发生如下的一些问题。 Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: Error: no display specified Error: no display specified Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’ System info: os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘3.4.76-65.111.amzn1.x86_64’, java.version: ‘1.7.0_51’ Driver info: driver.version: […]

Selenium WebDriver鼠标操作moveToElement不会在Firefox Linux上引发mouseout事件

我一直在尝试使用Selenium WebDriver和Firefox 19在我的网页上测试工具提示。 我基本上试图使用鼠标操作将鼠标hover在附加了工具提示的元素上,以测试工具提示是否显示,并将鼠标hover在另一个元素上以测试工具提示是否隐藏。 第一个操作正常,但当hover在另一个元素上时,工具提示仍然可见。 手动测试网页时不会发生此问题。 有没有其他人遇到过这个问题? 我正在使用Ubuntu 12.04。

Selenium在一台计算机上发生了“UnreachableBrowserException / Address has in use”

我有一个java webdriver驱动的selenium执行,它在列表上循环,在文本框中输入不同的信息并使用FirefoxDriver发送它。 在一台计算机上,在第10次或第11次迭代之后,相当可重现,调用findElement(By.id(“mi4”))会引发UnreachableBrowserException 。 Jun 29, 2012 1:52:02 PM org.apache.http.impl.client.DefaultRequestDirector tryConnect Information: I/O exception (java.net.BindException) caught when connecting to the target host: Address already in use: connect Jun 29, 2012 1:52:02 PM org.apache.http.impl.client.DefaultRequestDirector tryConnect Information: Retrying connect Jun 29, 2012 1:52:02 PM org.apache.http.impl.client.DefaultRequestDirector tryConnect Information: I/O exception (java.net.BindException) caught when connecting to the target host: […]

Selenium 3.0 Firefx驱动程序因org.openqa.selenium.SessionNotCreatedException而失败:无法创建新的远程会话

Selenium 3.0 Firefx驱动程序因org.openqa.selenium.SessionNotCreatedException而失败:无法创建新的远程会话。 System.setProperty(“webdriver.gecko.driver”, “…./geckodriver.exe”); capabilities = DesiredCapabilities.firefox(); capabilities.setCapability(“marionette”, true); driver = new FirefoxDriver(capabilities); Caused by: org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{marionette=true, firefoxOptions=org.openqa.selenium.firefox.FirefoxOptions@23aa363a, browserName=firefox, moz:firefoxOptions=org.openqa.selenium.firefox.FirefoxOptions@23aa363a, version=, platform=ANY}], required capabilities = Capabilities [{}] Build info: version: ‘3.0.0’, revision: ‘350cf60’, time: ‘2016-10-13 10:48:57 -0700’ System info: host: ‘D202540’, ip: ‘10.22.19.193’, os.name: […]

在PATH中找不到firefox二进制文件。 确保安装了firefox。 操作系统似乎是:VISTA

我无法在任何浏览器中运行我的脚本。 下面是我得到的firefox错误。 firefox的安装位置是正确的。 不知道出了什么问题。 我正在使用Firefox 15. Selenium Java 2.2.0和Eclipse Juno 我的测试用例如下: import static org.junit.Assert.*; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxProfile; public class FirstTest { private WebDriver _driver; @Before public void setUp() throws Exception { System.setProperty(“webdriver.firefox.driver”,”C:\\Program Files\\Mozilla Firefox15\\Firefox.exe”); FirefoxProfile firefoxProfile = new FirefoxProfile(); _driver = new FirefoxDriver(firefoxProfile); } […]

“安全设置阻止的应用程序”阻止在Linux上使用oracle SE 7更新51运行的applet

背景 在Linux上完成Oracle Java SDK(32位)的全新安装。 安装正确,插件已正确安装。 问题 当applet在Firefox中运行时,会出现以下错误(“安全设置阻止的应用程序”): 建立 以下是我使用的步骤: 在VBox上安装Linux mint 16: > uname -a Linux me-VirtualBox 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:12:00 UTC 2013 i686 i686 i686 GNU/Linux 清除所有Java实例 。 按照说明在Linux上安装 jdk-7u51-linux-i586.tar.gz。 已validation的安装> java -version java version “1.7.0_51” Java(TM) SE Runtime Environment (build 1.7.0_51-b13) Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode) 已validation的插件: […]