how-to-use-geckodriver in C#?

Hi all,

could you know how to use geckodiver in C# ? and i already tried in below code with all updated sources

 

[TestFixture(“Firefox”)]
[TestDirectory(“..\\..\\Accordion\\”)]
public class EmberJS_Accordion : NUnitUtil
{
string activeBrowser;

public EmberJS_Accordion(string browser)
{

FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(@”C:\Drivers”);
service.FirefoxBinaryPath = @”C:\Program Files (x86)\Mozilla Firefox\firefox.exe”;
System.Environment.SetEnvironmentVariable(“webdriver.gecko.driver”, “C:\\Drivers\\geckodriver.exe”);
FirefoxDriver driver = new FirefoxDriver(service); // FirefoxDriver driver = new FirefoxDriver();
//driver = GetWebDriverForBrowser(browser);
activeBrowser = browser;
}

[TestFixtureTearDown]
public void quitDriver()
{
driver.Quit();
}

Default Asked on December 14, 2017 in Selenium WebDriver.
Add Comment
  • 0 Answer(s)
  • Your Answer

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