Consise API to Selenium for .Net (the port of Selene in python / Selenide in Java)
Clone or download
Latest commit 2849f6b Jul 19, 2018

NSelene - Selenide "from scratch port" to .NET (C#, etc.)

A Tool created specifically for Web UI Test Automation in .NET world

So, Here it is... A more or less stabilized version, published to nuget gallery

The version was covered with integration tests. The coverage was not complete in context of all probable use cases, but the "integration aspect" makes it good enough.

You can use tests as docs ;)

There is also an example tests project:

Below you can find a short overview:

NSelene has no fully automatic driver management, you have to set it up manually, e.g. like here:

        public void InitDriver()
            SetWebDriver(new FirefoxDriver());

        public void TeardownDriver()


Tests may look like this, via PageObject implemented in a "Modular/Procedural way":

        public class TodoMvcTests : BaseTest
            public void FilterTasks()

                Tasks.Add("a", "b", "c");
                Tasks.ShouldBe("a", "b", "c");


                Tasks.ShouldBe("a", "c");



where "procedural PageObject" aka "PageModule" may look like this:

        public static class Tasks
            public static SeleneCollection List = SS("#todo-list>li"); 

            public static void Visit()

            public static void FilterActive()

            public static void FilterCompleted()

            public static void Add(params string[] taskTexts)
                foreach (var text in taskTexts) 

            public static void Toggle(string taskText)

            public static void ShouldBe(params string[] names)

See more examples of other styles, e.g. object oriented PageObjects, examples of how NSelene can be integrated into your current selenium based framework (to make it more stable and efficient) in NSeleneExamples project.

So... The main things are ported:

  • Selenide.$
  • SelenideElement#should
  • SelenideElement#shouldNot
  • SelenideElement#find / SelenideElement#$
  • SelenideElement#findAll / SelenideElement#$$
  • Selenide.$$
  • EllementsCollection#should
  • EllementsCollection#shouldNot
  • EllementsCollection#findBy
  • EllementsCollection#filterBy
  • EllementsCollection#get
  • all main Conditions
  • all main CollectionConditions

Though NSelene is not a "complete" port (no automatic screenshots, no automatic driver creation, etc.), even now It has some useful additions to the basic "selenide set" of features. The following a some features that are still absent in Selenide:

  • NSelene has better error messages for some complex queries like SS("#list-item").FindBy(Have.CssClass("specific")).Find(".inner-element").click()
  • NSelene can be much easyly integrated into existing selenium based frameworks, because it is object-oriented by its nature. It provides a Consice API to Selenium via both "OOP" (SeleneDriver class) and "static utils" wrappers (Selene static class) over WebDriver, not only "static utils wrappers" as in Selenide (Selenide utility class with static methods).
  • Because of the latter, NSelene also supports creation of "more than one driver per test". It can be rarely useful, but sometimes it "saves the life" on projects where "everything is too bad" :)

Feel free to share your thoughts and file an issue on github if you need something.