Monday

Microsoft Edge supports Selenium WebDriver


Good news for the test automation folks!
In another developer-friendly move, Microsoft announces that its new Edge browser supports the WebDriver automated testing technology.
Microsoft may be distancing its new Edge browser from Internet Explorer (IE) and its contentious past, but it is inheriting at least some developer features.
In addition to an improved set of F12 tools, the company announced that Edge supports WebDriver, an emerging automated site-testing standard from the World Wide Web Consortium (W3C). Windows Insiders, members of Microsoft's beta program, can test the functionality in build 10240 or newer. The company first added WebDriver support to IE 11 a year ago.
The use of WebDriver with Edge requires running Microsoft WebDriver server software with Microsoft Edge on Windows 10 (build 10240 and above). Microsoft halted downloads of the server after a "publishing issue" cropped up, but the company hopes to restore the software later today (July 24).
WebDriver helps developers test complex sites, allowing them to find and ultimately fix issues much faster than using manual methods. "It provides a programmable remote control for developing complex user scenarios and running them in an automated fashion against your Website in a browser," Microsoft Edge staffers Clay Martin, program manager; John Jansen, principal software engineer; Jatinder Mann, senior program manager lead; and Mark Conway, director of automation testing tool specialist Micro Focus,wrote in a joint blog post.

The tech helps developers maintain the quality of major Websites, including Microsoft's own search engine. "WebDriver is used by top Web properties like Bing, Azure, SharePoint, Facebook, Google and others to automate testing their sites within a browser," they noted. A key aim of the Edge project is to help al with the modern Web. To that end, Microsoft has worked to embrace more modern, developer-friendly Web standards. The company has even shed some hallmark IE technologies like ActiveX to further the cause.
Microsoft is also courting developers by streamlining their cross-browser testing workflows. "With this new capability, Microsoft Edge can be run through the same regression testing as other browsers, helping developers identify issues with less effort and making sites just work for our end users," stated the group.
To enable WebDriver support, Microsoft teamed with Micro Focus and its Borland subsidiary "to help contribute code to the WebDriver implementation in Microsoft Edge," they revealed.
"The Borland team is also bringing their expertise in automation testing to help inform the next level of changes we should pursue in the W3C standard." U.K.-based Micro Focus acquired Borland, known as a leader in the application lifecycle management and deployment solutions market, in 2009 for $75 million.

Typical of packages that allow users to dig into code, developers will need to perform some setup. "To get started using WebDriver, you will need to download a testing framework of your choice along with an appropriate language binding and the Microsoft WebDriver server," stated the group. Supported language bindings include C# and Java Selenium, with the goal of adding more to come in the future.


Friday

Organize step definitions - Cucumber best practices


Problem: How do we  organize step definitions in the BDD framework as they increase?

If you are using a BDD tool like Specflow/Cucumber/Jbehave  you have to define your step definitions for the feature files. Let's look at different ways to do that:

Journey to Ideal way of organizing step definitions: 
  1. Keeping all step definitions in a single class file. This approach quickly becomes impractical with more features
  2. Having separate classes. Now you have a new problem - wiring the instances of those classes together.
  3. One Class per Feature file - This is good  and also the most common approach except that how would you handle reusable step definitions
  4. ReUsableSteps file - Once you recognize that a step is reused, move it to a class ReUsableSteps or something. This way, if a step does not exist in its class then it should be in ReUsableSteps.
  5. Step Definition file for each domain concept - This solves the problem of tightly coupled step definitions and keep them logically separated.
  6. Page Step Definitions - This is my favorite and  is similar to the page object model being used for test automation. Loosely coupled step definitions that are logically separated.


Tuesday

BDD - Regular expression Generators / Evaluators

If you are using BDD and creating step definitions you surely are using a lot of regex, whatever is your reason to create regex there is no one solution that helps you generate them.
What we should realize is that there can't be a perfect regex generator but you definitely  can make use of software that helps you create them.

The closest tool that generates a regex is http://regex.inginf.units.it/\\
It uses a template-based, modularized and very generalized approach to regular expression generation. The expressions it generates works, but they are much more complex than the equivalent hand-crafted expression. Please look at the video tutorial here.

Solution:

The best tools that help you create your own regular expressions are:

 

Happy Regexing :P





Monday

POM file Maven Dependency Injection - CheatSheet



When you depend on a plugin or a dependency, you can use the a version value of LATEST or RELEASE.
  • LATEST refers to the latest released or snapshot version of a particular artifact, the most recently deployed artifact in a particular repository. 
  • RELEASE refers to the last non-snapshot release in the repository.
  • A square bracket ( [ & ] ) means "closed" (inclusive). 
  • A parenthesis ( ( & ) ) means "open" (exclusive).
Best Practice:
In general, it is not a best practice to design software which depends on a non-specific version of an artifact. If you are developing software, you might want to use RELEASE or LATEST as a convenience so that you don't have to update version numbers when a new release of a third-party library is released. When you release software, you should always make sure that your project depends on specific versions to reduce the chances of your build or your project being affected by a software release not under your control. Use LATEST and RELEASE with caution, if at all.

Here's an example illustrating the various options. In the Maven repository, com.foo:my-foo has the following metadata:


If a dependency on that artifact is required, you have the following options


  • Declare an exact version (will always resolve to 1.0.1):
  • Declare an explicit version (will always resolve to 1.0.1 unless a collision occurs, when Maven will 
  • Declare a version range for all 1.x (will currently resolve to 1.1.1):
  • Declare an open-ended version range (will resolve to 2.0.0):
  • Declare the version as LATEST (will resolve to 2.0.0):
  • Declare the version as RELEASE (will resolve to 1.1.1):