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

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();
        }
有帮助吗?

解决方案

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

new FirefoxDriver();  

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top