The type or namespace name 'IWebDriver' could not be found error while executing Nunit test through Selenium on Visual Studio 2017

前端 未结 1 1160
难免孤独
难免孤独 2021-01-25 22:05

I am trying to create some test cases with selenium on a mac with C#. The IDE I am using is visual studio 2017. I have the following packages installed , selenium web driver, se

相关标签:
1条回答
  • 2021-01-25 22:27

    Referring to a few previous posts it seems if you are using Selenium-WebDriver through frameworks like Visual Studio 2017, nunittestadapter, NUnit.Framework, VS 2017 using the NuGet Manager sometimes there can be issues with the installation /configuration.

    Example: SelectElement Class

    As per the documentation the SelectElement Class is pretty much available within OpenQA.Selenium.Support.UI Namespace which provides a convenience method for manipulating selections of options in an HTML select element.


    Inheritance Hierarchy

    System.Object
        OpenQA.Selenium.Support.UI.SelectElement
    

    Namespace: OpenQA.Selenium.Support.UI


    Assembly: WebDriver.Support (in WebDriver.Support.dll) Version: 3.1.0


    Syntax: public class SelectElement : IWrapsElement


    Snapshot:

    Solution

    Uninstall & reinstall the Selenium.Webdriver and Selenium.Support packages, that will surely fix the problem.

    Reference

    You can find relevant discussions in

    • Cannot find WebDriverWait class in OpenQa Selenium 3.7
    • The type or namespace SelectElement could not be found in selenium c#
    0 讨论(0)
提交回复
热议问题