-
-
Save akrisiun/9d033b27f97fb3c518e430de78479a90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using OpenQA.Selenium; | |
using OpenQA.Selenium.Edge; | |
using OpenQA.Selenium.Remote; | |
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) | |
{ | |
RemoteWebDriver driver = null; | |
try | |
{ | |
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(); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine(e.Message); | |
} | |
finally | |
{ | |
if (driver != null) | |
{ | |
driver.Quit(); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment