How to instantiate InternetExplorerDriver with Selenium WebDriver using C#

后端 未结 5 1405
抹茶落季
抹茶落季 2021-01-17 18:45
new InternetExplorerDriver();

But I could see exception as below:

OpenQA.Selenium.DriverServiceNotFoundException was unhandled by u         


        
5条回答
  •  遇见更好的自我
    2021-01-17 19:06

    You can pass in the path to the IEDriverServer in an overload of the constructor

    namespace OpenQA.Selenium.IE
        //
        // Summary:
        //     Initializes a new instance of the OpenQA.Selenium.IE.InternetExplorerDriver class
        //     using the specified path to the directory containing IEDriverServer.exe.
        //
        // Parameters:
        //   internetExplorerDriverServerDirectory:
        //     The full path to the directory containing IEDriverServer.exe.
        public InternetExplorerDriver(string internetExplorerDriverServerDirectory);
    

    so

    new InternetExplorerDriver("..\.."); // if it was two folders up
    

提交回复
热议问题