Skip to content

Instantly share code, notes, and snippets.

@henesgokdag
Created July 18, 2021 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henesgokdag/4acb3b38ef4b59790f5932e9b48c5fcb to your computer and use it in GitHub Desktop.
Save henesgokdag/4acb3b38ef4b59790f5932e9b48c5fcb to your computer and use it in GitHub Desktop.
BrowserUtility.cs
public class BrowserUtility
{
IWebDriver webDriver;
public IWebDriver ChromeDriver(string url)
{
ChromeOptions options = new ChromeOptions();
options.AddArguments("start-maximized");
options.AddArguments("disable-popup-blocking");
options.AddArguments("disable-popup-blocking");
webDriver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), options);
webDriver.Navigate().GoToUrl(url);
return webDriver;
}
public void GoToUrl(string url)
{
webDriver.Navigate().GoToUrl(url);
}
public void DriverClose()
{
webDriver.Quit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment