main method error when using c# selenium with NUnit framework

i created a simple class for opening google page through selenium webdriver using c#
in tutorial there was no use for main function , but when i ran the code the error is there that it couldnt find the main function

the error string is

Error 1 Program ‘c:\Users\saurabh.verma\Documents\Visual Studio 2013\Projects\ConsoleApplication1\ConsoleApplication1\obj\Debug\ConsoleApplication1.exe’ does not contain a static ‘Main’ method suitable for an entry point C:\Users\saurabh.verma\Documents\Visual Studio 2013\Projects\ConsoleApplication1\ConsoleApplication1\CSC ConsoleApplication1

the program is

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Support;
using NUnit.Framework;

namespace ConsoleApplication1
class Program
IWebDriver driver;

public void TestMethod1()
driver = new FirefoxDriver();
Assert.AreEqual(“Google”, driver.Title);
public void EndTest()

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.