How to run selenium with firefox driver

I am trying to follow this link: http://www.seleniumhq.org/docs/03_webdriver.jsp

In SetUpTest:

protected IWebDriver driver;
protected ISelenium selenium;
[SetUp]
public void SetupTest()
{
    driver = new FirefoxDriver();
    selenium = new DefaultSelenium(
        "localhost", 
        4444,
        "*chrome",
        "http://localhost");
    selenium.Start();
    verificationErrors = new StringBuilder();
}

When this line driver = new FirefoxDriver();is executed, I have this error:

Additional information: Cannot find a file named '***[Link to my project]\webdriver.xpi' or an embedded resource with the id 'WebDriver.FirefoxExt.zip'.

When I change it to driver = new ChromeDriver();, it opens firefox, but it cannot find the element, although the element is already displayed.

How to make selenium work with firefox?

+4
source share
1 answer

If you used C #, it means that you added Nuget packages of both Selenium.NET bindings and Firefox Driver

https://docs.microsoft.com/en-us/vsts/build-release/test/continuous-test-selenium#create-the-test-project.

Selenium , . Unit Test " NuGet". :

Selenium.WebDriver

Selenium.WebDriver.ChromeDriver

Selenium.WebDriver.IEDriver

Selenium.Firefox.WebDriver

Selenium.WebDriver.PhantomJS.Xplatform

. Firefox-, Selenium.WebDriver (, Selenium.Support) Selenium.Firefox.WebDriver. Selenium.WebDriver.PhantomJS.Xplatform, WebDriver.dll , .json .xpi.

0

All Articles