简体   繁体   English

从 selenium rc 升级到 webdriver

[英]upgrade from selenium rc to webdriver

hi iam using selenium rc 1.0.3 (java client).嗨,我使用 selenium rc 1.0.3(java 客户端)。 If i want to upgrade to WebDriver, will there be backward compatibility?如果我想升级到 WebDriver,会有向后兼容性吗? Will it be like simply using webdriver jar and methods will be same?会不会像简单地使用 webdriver jar 和方法一样? Or, Will it be like writing from scrap?或者,它会像用废品写作吗?

You can use WebDriverBackedSelenium to create a selenium impelementation您可以使用WebDriverBackedSelenium创建一个 selenium impelementation

WebDriver driver = new FirefoxDriver();
Selenium selenium = new WebDriverBackedSelenium(driver, URL);
selenium.open()
selenium.type() or any other function;

This way your existing selenium functions need not be written and new functions can use driver .这样您现有的 selenium 函数就无需编写,新函数可以使用driver

The following info is available at this link链接提供以下信息

Pros优点

Allows for the WebDriver and Selenium APIs to live side-by-side允许 WebDriver 和 Selenium API 并行使用

Provides a simple mechanism for a managed migration from the Selenium RC API to WebDriver's提供从 Selenium RC API 到 WebDriver 的托管迁移的简单机制

Does not require the standalone Selenium RC server to be run不需要运行独立的 Selenium RC 服务器

Cons缺点

Does not implement every method没有实现所有方法

More advanced Selenium usage (using “browserbot” or other built-in JavaScript methods from Selenium Core) may not work更高级的 Selenium 用法(使用“browserbot”或来自 Selenium 核心的其他内置 JavaScript 方法)可能不起作用

Some methods may be slower due to underlying implementation differences由于底层实现差异,某些方法可能会更慢

As per my experience it was worthwhile to move from Selenium RC to WebDriver.根据我的经验,从 Selenium RC 迁移到 WebDriver 是值得的。 While moving to WebDriver I also refactored my automation framework to make it more user friendly, robust, maintainable and scalable.在迁移到 WebDriver 的同时,我还重构了我的自动化框架,使其更加用户友好、健壮、可维护和可扩展。 The kind of tools, strategies and patterns I used are explained in detail at Web GUI automation tools strategies patterns我使用的工具、策略和模式在Web GUI 自动化工具策略模式中有详细说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM