Authenticating to Salesforce with Silenium in C#

It is pretty easy to authenticate to Salesforce with Silenium in C#. Here are the steps.

  1. Add the following NuGET package to your project:
    Silenium WebDriver
  2. Use the following code:
        public static void LoginToSalesforce(string username, string password)
            IWebDriver driver = new FirefoxDriver();
            driver.Url = "";
            var userNameTextBox = driver.FindElement(By.Id("username"));
            var passwordTextBox = driver.FindElement(By.Id("password"));
            var loginButton = driver.FindElement(By.Id("Login"));

Yes it is that easy.

Leave a Reply

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