1

I am trying to launch this browser & the code worked previously:

namespace AutoFramework
{
    using OpenQA.Selenium;
    using OpenQA.Selenium.Chrome;
    using System;

    public static class Driver
    {
        //public static IWebDriver driver { get; set; }

        public static IWebDriver driver = new ChromeDriver();

        public static void WaitForElementUpTo(int sec`enter code here`onds = 5)
        {
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(seconds);
        }
    }
}
1
  • "public static IWebDriver driver = new ChromeDriver();" it should not start FireFox. It should start Chrome. Moreover asaiu your should at least get the page to make the browser open (not sure about that).
    – Alexey R.
    Commented Mar 27, 2018 at 12:47

2 Answers 2

2

You are invoking the chrome driver so chrome browser will gets opened not Firefox browser. Moreover there is no URL defined in the code for redirecting the webpage should open. So add the following line to make this code work

driver.get("https://www.google.com");

This line will open the google page in chrome browser.

0

Your title/body of the question is a bit misleading. As someone mentioned, you're looking for Firefox to launch but your code is using ChromeDriver.

This shouldn't matter too much, as the fix is to change your using statements to firefox and your driver instantiation to firefox as well.

Could you please provide a bit more of a description other than its not working? That may help us diagnose the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.