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