I have a class named test.cs:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using OpenQA.Selenium.Support.PageObjects;
using qa.WrapperFactory;
namespace Common.PageObjects
{
    public class Test
    {
        [FindsBy(How = How.XPath, Using = "xpath")]
        private IWebElement foundElement;
        [FindsBy(How = How.XPath, Using = "xpath")]
        private IWebElement EnvironmentLogoElement;
        [FindsBy(How = How.XPath, Using = "xpath")]
        private IWebElement UsernameElement;
        [FindsBy(How = How.Id, Using = "xpath")]
        private IWebElement PasswordElement;
        public void Setup()
        {
            // Set window to full screen
            BrowserFactory.Driver.Manage().Window.Maximize();
            // Clear all cookies
            BrowserFactory.Driver.Manage().Cookies.DeleteAllCookies();
        }
        public void CheckLoginPage ()
        {
            WaitMethods.WaitForShort(() => foundElement.Displayed);
            Assert.IsTrue(UsernameElement.Displayed);
            Assert.IsTrue(PasswordElement.Displayed);
        }
    }
}
I want to call the method public void CheckLoginPage () from the specflow steps. that looks like this:
using System.Configuration;
using Common.PageObjects;
using qa.WrapperFactory;
using TechTalk.SpecFlow;
namespace RegressionTest
{
    [Binding]
    public class SmokeTestSteps
    {
        [Given(@"I go to the HRControlnet login page")]
        public void GivenIGoToTheHRControlnetLoginPage()
        {
            BrowserFactory.InitBrowser("Firefox");
            var subDomain = ConfigurationManager.AppSettings["Environment"];
            BrowserFactory.LoadApplication(subDomain);
        }
        [Then(@"the result should be on the screen")]
        public void ThenTheResultShouldBeOnTheScreen()
        {
            Test.CheckLoginPage();
        }
    }
}
I get now the error on the step ThenTheResultShouldBeOnTheScreen() with Error CS0120 An object reference is required for the non-static field, method, or property.
I tried to make CheckLoginPage () a static but then all the xpaths give an error.
Anyone can help me out on how to fix this?
 
     
    