Selenium PageFactory does not work in .NET Core 2.0

In this post we will discuss one of the recent burning issue with Selenium PageFactory which does not work in .NET Core 2.0 framework.

Selenium 3.6.0 and 3.7.0 are the first official package to natively support .Net Standard 2.0 as opposed to earlier version which even though works in .NET Core 2.0 framework, will still see warnings in references as shown below

 

But the problem now with Selenium 3.6.0 and Selenium 3.7.0 is its missing one of the most important Class PageFactory used for Page Object Model and Page Navigation, which we can literally see from the Object browser of visual studio in comparison with .NET framework 4.7

 

Here is the change log of Selenium 3.6.0

Here is the complete video of the above discussion

Thanks for reading the post and watching the video!!!

Please leave your comments and let me know if there is anything I should update in this post.

Thanks,
Karthik KK

3 comments

  1. Scott says:

    I had this same problem with PageFactory not being available for .NET Core, but then I found Atata Framework and it gave me a fluent Page Object model out of the box, so I didn’t have to roll my own.

  2. Agustin says:

    Hello, Could you help me with this?
    How I can replace this Generic Page Administrator with the new implementation of PageFactory? Thanks!

    private static T GetPage() where T : new()
    {
    var page = new T();
    PageFactory.InitElements(Browser.Driver, page);
    return page;
    }

    public static AboutPage About
    {
    get { return GetPage(); }
    }

Leave a Reply

Your email address will not be published. Required fields are marked *