Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium geckodriver executes findElement 10 times slower than chromedriver (.Net)

Sorry didn't find a similar question and maybe somebody can help.

Due to additional requirements we have to test our project not only with Chrome but with Firefox as well. When we simply changed a test context to Firefox it turned out that all calls of findElement took 10 times more time than with Chrome. All tests are completely ruined. We tried to use different test machines but the results are the same. The project is on Core .Net. For testing we use MSTest V2, Firefox 63 (64 bit) and Geckodriver 0.22 (64 bit) .

Very appreciate any help.

like image 221
Nick Avatar asked Dec 05 '18 09:12

Nick


1 Answers

By referring to the previous answer, my issue was solved by below code.

string geckoDriverDirectory = "Path of geckodriver.exe"
FirefoxDriverService geckoService = 
FirefoxDriverService.CreateDefaultService(geckoDriverDirectory);
geckoService.Host = "::1";
var firefoxOptions = new FirefoxOptions();
firefoxOptions.AcceptInsecureCertificates = true;
Driver = new FirefoxDriver(geckoService, firefoxOptions);
like image 71
gary.zhang Avatar answered Sep 22 '22 04:09

gary.zhang