Skip to content

Version 2

Lukasz Rajchel edited this page Jun 4, 2018 · 4 revisions

The new features of V2 include:

  • Selectors inheriting from OpenQA.Selenium.By class. V1 of the application used the trick to run the custom selectors (extension methods, object wrappers etc.) and in the end it was quite difficult to tell which part it handled by the extensions and which by Selenium core. V2 will include completely rewritten JQuery and Sizzle selectors that will inherit from By class to avoid those kind of tricks.
  • Removal of redundant core selectors. V1 contains implementation of core Selenium selectors using custom QuerySelector class. The purpose of this class is to wrap the results in custom WebElement class for them to be reused while determining the context of the subsequent call. With the implementation of By class, they will no longer be needed and will be removed from the library.
  • Removal of query selector. As described above, QuerySelector class will no longer be necessary and will be removed in V2.
  • Single NuGet package. There will be only one NuGet package containing all of the extenions instead of four separate packages that V1 included. The extensions library is small enough for all of the important code to be merged into one package.
  • Support for JQuery getters and setters will be dropped. V1 included a mechanism to run JQuery getters and setters as most of the calls used JQueryHelper class as an mediator between Selenium core and extensions library. With the new architecture there is no place for the JQueryHelper anymore and the support for those methods will be dropped. The only jQuery methods supported are now traversing methods.
  • Semantic versioning. V2 will utilize SemVer from the first release rather than V1's {major}.{minor}.{build} schema.
  • Support for ExpectedConditions. By implementing the By class, V2 of the extensions library will come with the support for ExpectedConditions.
  • Support for page objects. By implementing the By class, V2 of the exntesions library will come with the support for Selenium page objects.
  • Changes to the static By implementations. There will still be a By class provided with static methods for creating all sorts of selectors, however it will simply be a wrapper on a base class that will also provide methods for the new selectors.
  • Namespace change. The namespace of the extensions library is going to be changed from Selenium.WebDriver.Extensions to OpenQA.Selenium which will make integration with Selenium even easier.

Migrating from V1 to V2

  1. Make sure that you are not using any of the removed features mentioned above. If you do you should stick with V1 or update your code so it doesn't use the removed features.
  2. Update the package for Selenium.WebDriver.Extensions and remove Selenium.WebDriver.Extensions.Core, Selenium.WebDriver.Extensions.JQuery and Selenium.WebDriver.Extensions.Sizzle packages from your projects.
  3. Replace any reference to JQuery().Load() and Sizzle().Load() methods with JQueryLoad() and SizzleLoad() calls.
  4. Update the using section of your test files by removing old namespaces (V2 works in the same namespace as Selenium core).
  5. Update the alias to By class to using By = OpenQA.Selenium.Extensions.By.