You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Automatic Selenium WebDriver binaries management for .Net
7
+
This small library aimed to automate the [Selenium WebDriver] binaries management inside a .Net project.
8
8
9
-
Original application idea is going from - [Boni García].
10
-
Java implementation you can find here - [GitHub Repository].
11
-
12
-
This piece of software is a small library aimed to automate the [Selenium WebDriver] binaries management inside a .Net project.
13
-
14
-
If you have ever used [Selenium WebDriver], you probably know that in order to use some browsers (for example **Chrome**, **Internet Explorer**, **Opera**, **Microsoft Edge**, **PhantomJS**, **Marionette** or **Appium**) you need to download a binary which allows WebDriver to handle the browser.
9
+
If you have ever used [Selenium WebDriver], you probably know that in order to use some browsers (for example **Chrome**) you need to download a binary which allows WebDriver to handle the browser.
15
10
In addition, the absolute path to this binary must be set as part of the PATH environment variable or manually copied to build output folder (working directory).
16
11
17
12
This is quite annoying since it forces you to link directly this binary in your source code. In addition, you have to check manually when new versions of the binaries are released. This library comes to the rescue, performing in an automated way all this dirty job for you.
@@ -29,88 +24,113 @@ Use the GUI or the following command in the Package Manager Console:
29
24
30
25
Then you can let WebDriverManager.Net to do manage WebDriver binaries for your application/test. Take a look to this NUnit example which uses Chrome with Selenium WebDriver:
31
26
32
-
namespace BrowserTests
33
-
{
34
-
using OpenQA.Selenium;
35
-
using OpenQA.Selenium.Chrome;
36
-
using WebDriverManager.BrowserManagers;
37
-
38
-
[TestFixture]
39
-
public class ChromeTest
40
-
{
41
-
protected IWebDriver driver;
42
-
43
-
[TestFixtureSetUp]
44
-
public void FixtureSetUp()
45
-
{
46
-
new ChromeDriverManager().Init();
47
-
}
48
-
49
-
[SetUp]
50
-
public void TestSetUp()
51
-
{
52
-
driver = new ChromeDriver();
53
-
}
54
-
55
-
[TestFixtureTearDown]
56
-
public void teardown()
57
-
{
58
-
if (driver != null)
59
-
driver.Quit();
60
-
}
61
-
62
-
[Test]
63
-
public void Test()
64
-
{
65
-
// Using Selenium WebDriver to carry out automated web testing
66
-
}
67
-
}
68
-
}
69
-
70
-
Notice that simple adding ``new ChromeDriverManager().Init();`` WebDriverManager does magic for you:
27
+
using NUnit.Framework;
28
+
using OpenQA.Selenium;
29
+
using OpenQA.Selenium.Chrome;
30
+
using WebDriverManager;
31
+
using WebDriverManager.DriverConfigs.Impl;
32
+
33
+
namespace Test
34
+
{
35
+
[TestFixture]
36
+
public class Tests
37
+
{
38
+
private IWebDriver _webDriver;
39
+
40
+
[SetUp]
41
+
public void SetUp()
42
+
{
43
+
new DriverManager().SetUpDriver(new ChromeConfig());
2. Also you can specify target binary architecture, for this case you need to include reference and specify architecture in class constructor using paramet
0 commit comments