Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
511 views
in Technique[技术] by (71.8m points)

c# - Selenium with Microsoft Edge driver never finishes initialising

I'm using the C# bindings for Selenium and trying to get a simple automated test in Microsoft Edge working.

class Program
{
    static void Main(string[] args)
    {
        EdgeOptions options = new EdgeOptions();
        options.PageLoadStrategy = EdgePageLoadStrategy.Eager;
        RemoteWebDriver driver = new EdgeDriver();
        driver.Url = "http://bing.com/";
    }
}

But the program halts on the initialisation of the EdgeDriver, the edge browser launches but the url never changes to "bing.com".

Has anyone else experienced this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I have faced the same issue. I followed the below steps to resolve it :-

Download the correct Microsoft WebDriver server version for your build.

How to find your correct build number :-

1- Go to Start > Settings > System > About and locate the number next to OS Build on the screen. This is your build number. Having the correct version of WebDriver for your build ensures it runs correctly.

2- Run this command systeminfo | findstr /B /C:"OS Version" this will give the output like OS Version: 10.0.10586 N/A Build 10586. Here is build number is 10586

You need to check your Windows OS build number and download appropriate .msi and install it.

Provide the Syetem property where MicrosoftWebDriver.exe installed to webdriver.edge.driver.

Note :- The Default installed location of the MicrosoftWebDriver.exe :-

for 64 bit is C:Program Files (x86)Microsoft Web Driver
for 32 bit is C:Program FilesMicrosoft Web Driver

Hope it will work...:)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...