How to stop invoking of Firefox browser before opening any othre browser in selenium web driver cross browser testing

StackOverflow https://stackoverflow.com/questions/23291753

Question

I am using selenium WD in C# for cross browser testing but facing a strange problem that when ever i run my test using Nunit firstly Firefox window will open & then my desired browser window will open & run the test on it(desired browser).

As per my knowledge if any system is not having Firefox installed in it then it fails the script.

So is there any way to change this default value of browser in selenium.

I am able to run tests on different browser, my problem is only that before opening my desired browser by default first system is opening firefox. which create issue for me & my tests.

        public void SetupTest()
        {
            driver = new SafariDriver();
            baseURL = "http://google.com/";
            verificationErrors = new StringBuilder();
        }
Was it helpful?

Solution

Most probably, somewhere in your code you are initializing the Firefox Driver. Search for this within you code:

new FirefoxDriver();  

OTHER TIPS

You could also debug to the line

driver = new SafariDriver();

and see if it has an assigned value already.

But I am also pretty certain that you are initializing a FirefoxDriver somewhere.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top