【问题标题】:How to perform webdriver backed selenium in selenium 3?如何在 selenium 3 中执行 webdriver 支持的 selenium?
【发布时间】:2017-01-31 02:33:29
【问题描述】:

如何在 selenium 3 中执行 webdriver 支持的 selenium?

Selenium 3 最近删除了名为“webdriver backed selenium”的功能

我必须执行鼠标悬停,键入这样的操作,这在 Selenium 3 中不再支持。

selenium = new WebDriverBackedSelenium(driver, "http://www.google.com");
selenium.openWindow("http://www.google.com", "google");
selenium.mouseOver(anElement);

我已尝试使用 moveToElement 方法,但它不会在我的站点中执行。 这就是为什么我在 Selenium 2 (WebDriver) 中使用 webdriver 支持的 selenium。

我必须做些什么才能在 Selenium 3 中实现这一点

【问题讨论】:

    标签: selenium automation selenium-rc browser-automation selenium3


    【解决方案1】:

    您可能知道,WebDriverBackedSelenium 提供了与 Selenium 1.x (Selenium RC) 兼容的接口,但它是 100% 使用 WebDriver 实现的。

    使用它有很多缺点,例如 - WebDriverBackedSelenium 比直接使用 WebDriver API 慢得多。但是让我们坚持原来的问题:)

    对于release of Selenium 3.0,决定删除原来的 Selenium Core 实现。对于使用旧 RC 接口的接口,Selenium 团队提供了一种由 WebDriver 支持的替代实现,它与自发布以来作为 Selenium 2 的一部分提供的 WebDriverBackedSelenium 相同。

    这个实现是Selenium Leg Rc。为了使用它,只需在项目中包含依赖项,例如,使用 Maven:

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-leg-rc</artifactId>
        <version>3.0.1</version>
    </dependency>
    

    现在您将能够像以前一样使用 Selenium 3.0 和 WebDriverBackedSelenium。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-11
      • 1970-01-01
      • 1970-01-01
      • 2012-09-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多