using OpenQA.Selenium; | |
using OpenQA.Selenium.Edge; | |
using System; | |
namespace EdgeDriverTests | |
{ | |
public class Program | |
{ | |
/* | |
* This assumes you have added MicrosoftWebDriver.exe to your System Path. | |
* For help on adding an exe to your System Path, please see: | |
* https://msdn.microsoft.com/en-us/library/office/ee537574(v=office.14).aspx | |
*/ | |
static void Main(string[] args) | |
{ | |
/* You can find the latest version of Microsoft WebDriver here: | |
* https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ | |
*/ | |
var driver = new EdgeDriver(); | |
// Navigate to Bing | |
driver.Url = "https://www.bing.com/"; | |
// Find the search box and query for webdriver | |
var element = driver.FindElementById("sb_form_q"); | |
element.SendKeys("webdriver"); | |
element.SendKeys(Keys.Enter); | |
Console.ReadLine(); | |
driver.Quit(); | |
} | |
} | |
} |
This comment has been minimized.
This comment has been minimized.
using OpenQA.Selenium.Edge; do u mean 'import org.openqa.selenium.Edge;' Edge class is not there in the package sir ... and when i copy the code 'System.Environment.Is64BitOperatingSystem' : Environment is also not defined .. Please help me to execute my first test in edge.... |
This comment has been minimized.
This comment has been minimized.
@cocasio Change the Edge home page to an actual page (ie. http://google.com) instead of the default "Start page" option. I struggled with this for a bit. I suppose it's because the driver requests a session and since there's no page loaded there isn't a session and it hangs. |
This comment has been minimized.
This comment has been minimized.
Im having the same problem as Cocasio had, also tried to change the default page to a actual page, but sill no luck, shows an error: No such driver, do you have any clue on this one? |
This comment has been minimized.
This comment has been minimized.
Updated the gist, give it a try now |
This comment has been minimized.
This comment has been minimized.
What Cocasio has got error, still same error is getting for me. The alternative way to invoke edge browser is: And then you can write navigate, click all statements. this works for me. But for the above error microsoft team should show us a solution. |
This comment has been minimized.
This comment has been minimized.
Hello, I am getting driver as null on "driver = new EdgeDriver(serverPath, options)", not sure what is causing the issue. Edge is opened and then I get the error. In Catch statement I get "unknown error". Quick help will be appreciated. Thanks, |
This comment has been minimized.
This comment has been minimized.
Sorry, I have fixed the issue, was using incorrect web driver for edge Thanks, |
This comment has been minimized.
This comment has been minimized.
hi, how to we set in a protractor config file for edge driver? |
This comment has been minimized.
This comment has been minimized.
I've updated the public gist to no longer require RemoteWebDriver and be a simpler example. |
This comment has been minimized.
This comment has been minimized.
For anyone having issue and managed to land here, I was receiving the following two errors:
These were both caused by an incorrect version of the MicrosoftWebDriver. My suggestion is even if you're able to manually launch the driver and it appears to be working, head here and download the version that matches your version of Microsoft Edge (Microsoft Edge 38.14393.2068.0 / Microsoft EdgeHTML 14.14393 in my case) |
This comment has been minimized.
This comment has been minimized.
I am trying to execute mgsedgedriver on Mac. I am seeing this error -- If I don't put file at specified path then I see file not found error and when file is present then I see this. I can open driver by double clicking on it. So not sure what's going on here. |
This comment has been minimized.
This comment has been minimized.
You'll probably find that the version of the MicrosoftWebDriver is incorrect. I received this error in that case and downloading the correct version as per my version of Edge resolved the error. |
This comment has been minimized.
This comment has been minimized.
Thank you. I have Version 77.0.211.3 (Official build) Dev (64-bit) installed on my Mac and downloaded matching driver. Still receiving this error. I just double checked it. |
This comment has been minimized.
This comment has been minimized.
I could not get this to work either. I am using the new Chromium Edge and that is a likely problem. I found WebDriver (Chromium) but that had problems too. I did a little guessing and the following works for me. I hope this is relevant.
|
This comment has been minimized.
This comment has been minimized.
How to open as headless with no window? |
This comment has been minimized.
Using Edge Browser 20.10240.16384.0 : WebDriver 10.0.10240.0 this code generate an error: An exception of type 'OpenQA.Selenium.WebDriverException' occurred in WebDriver.dll but was not handled in user code
Additional information: The HTTP request to the remote WebDriver server for URL
http://localhost:51421/session timed out after 60 seconds.