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