Question

what is the Best practice for designing gherkin based UI Automation framework using selenium

  • Browser instance
  • For Feature wise steps definitions or page wise.
  • Exception handling
  • Logging functionality
  • Execution According to feature or Scenario using MSTest
  • Integration With Continuous Integration tool like jenkin.
Was it helpful?

Solution

Have you invested any time at looking what's possible so far?

Browser instance - Doesn't that depend on which browser you want selenium to automate, for example, would you want to run the same actions on different browsers to test it works on each one?

Feature wise or page wise steps - Specflow doesn't care, it treats all bindings as global so it really is a personal thing. The only issue comes where you mix bindings from different classes and expect them to share some data, but even then Specflow has some pretty neat DI like instantiation to make it easier.

Exception handling - this isn't relevant during testing. You simply want something that gets out of the way and lets you see it fail when expected.

Logging - During testing you don't care. Just pick something with a null logger.

Execution of specific tests - see ReSharper or built in runner in VS2012+, or even better ncrunch

CI integration - Since Specflow tests are just Nunit or MsTest tests then any CI system should just handle them. I'd pick TeamCity as it's probably the standard for DotNet CI

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top