Skip to content

Commit f3eea77

Browse files
committed
Temporary disable this functionality because of wrong path override
1 parent cd08cad commit f3eea77

File tree

12 files changed

+189
-21
lines changed

12 files changed

+189
-21
lines changed

WebDriverManager/BrowserManagers/ChromeDriverManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ public void Base()
8181
WebDriverManager.Unzip(config);
8282
WebDriverManager.Clean();
8383
WebDriverManager.AddEnvironmentVariable(config.pathVariable);
84-
WebDriverManager.UpdatePath(config.pathVariable);
84+
// Temporary disable this functionality because of wrong path override
85+
//WebDriverManager.UpdatePath(config.pathVariable);
8586
}
8687
}
8788
}

WebDriverManager/BrowserManagers/EdgeDriverManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ public void Base()
6666
{
6767
WebDriverManager.Download(config);
6868
WebDriverManager.AddEnvironmentVariable(config.pathVariable);
69-
WebDriverManager.UpdatePath(config.pathVariable);
69+
// Temporary disable this functionality because of wrong path override
70+
//WebDriverManager.UpdatePath(config.pathVariable);
7071
}
7172
}
7273
}

WebDriverManager/BrowserManagers/InternetExplorerDriverManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ public void Base()
136136
WebDriverManager.Unzip(config);
137137
WebDriverManager.Clean();
138138
WebDriverManager.AddEnvironmentVariable(config.pathVariable);
139-
WebDriverManager.UpdatePath(config.pathVariable);
139+
// Temporary disable this functionality because of wrong path override
140+
//WebDriverManager.UpdatePath(config.pathVariable);
140141
}
141142
}
142143
}

WebDriverManager/BrowserManagers/MarionetteDriverManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ public void Base()
8989
WebDriverManager.Unzip(config);
9090
WebDriverManager.Clean();
9191
WebDriverManager.AddEnvironmentVariable(config.pathVariable);
92-
WebDriverManager.UpdatePath(config.pathVariable);
92+
// Temporary disable this functionality because of wrong path override
93+
//WebDriverManager.UpdatePath(config.pathVariable);
9394
}
9495
}
9596
}

WebDriverManager/BrowserManagers/OperaDriverManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ public void Base()
108108
WebDriverManager.Unzip(config);
109109
WebDriverManager.Clean();
110110
WebDriverManager.AddEnvironmentVariable(config.pathVariable);
111-
WebDriverManager.UpdatePath(config.pathVariable);
111+
// Temporary disable this functionality because of wrong path override
112+
//WebDriverManager.UpdatePath(config.pathVariable);
112113
}
113114
}
114115
}

WebDriverManager/BrowserManagers/PhantomJsDriverManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ public void Base()
7878
WebDriverManager.Unzip(config);
7979
WebDriverManager.Clean();
8080
WebDriverManager.AddEnvironmentVariable(config.pathVariable);
81-
WebDriverManager.UpdatePath(config.pathVariable);
81+
// Temporary disable this functionality because of wrong path override
82+
//WebDriverManager.UpdatePath(config.pathVariable);
8283
}
8384
}
8485
}

WebDriverManager/Helpers/WebDriverManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ public static void UpdatePath(string variable)
188188
{
189189
var name = "PATH";
190190
string pathvar = Environment.GetEnvironmentVariable(name);
191-
var path = pathvar + $@";%{variable}%";
191+
var path = pathvar + $@"%{variable}%";
192192

193-
if (!pathvar.Contains(variable))
193+
if (!pathvar.Contains(desticationFolder))
194194
Environment.SetEnvironmentVariable(name, path, EnvironmentVariableTarget.Machine);
195195
}
196196
catch (Exception ex)

WebDriverManager/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Alexander Rosolko
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

WebDriverManager/README.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
[![AppVeyor](https://img.shields.io/appveyor/ci/rosolko/webdrivermanager-net.svg?maxAge=3600)](https://ci.appveyor.com/project/rosolko/webdrivermanager-net)
2+
[![NuGet](https://img.shields.io/nuget/v/WebDriverManager.svg?maxAge=3600)](https://www.nuget.org/packages/WebDriverManager)
3+
[![GitHub release](https://img.shields.io/github/release/rosolko/WebDriverManager.Net.svg?maxAge=3600)](https://github.com/rosolko/WebDriverManager.Net/releases/latest)
4+
[![license](https://img.shields.io/github/license/rosolko/WebDriverManager.Net.svg?maxAge=3600)](https://github.com/rosolko/WebDriverManager.Net/blob/master/LICENSE)
5+
6+
# WebDriverManager.Net
7+
Automatic Selenium WebDriver binaries management for .Net
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.
15+
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+
17+
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.
18+
19+
WebDriverManager is open source, released under the terms of [MIT] license.
20+
21+
## Installation
22+
23+
[WebDriverManager.Net] can be downloaded from NuGet.
24+
Use the GUI or the following command in the Package Manager Console:
25+
26+
PM> Install-Package WebDriverManager
27+
28+
## Usage
29+
30+
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+
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+
// Using Selenium WebDriver to carry out automated web testing
65+
}
66+
}
67+
}
68+
69+
Notice that simple adding ``new ChromeDriverManager().Init();`` WebDriverManager does magic for you:
70+
71+
1. It checks the latest version of the WebDriver binary file
72+
2. It downloads the binary WebDriver if it is not present in your system
73+
74+
So far, WebDriverManager supports **Chrome**, **Microsoft Edge**, **Internet Explorer**, **Marionette**, **Opera**, **PhantomJS** or **Appium** as follows:
75+
76+
new ChromeDriverManager().Init();
77+
new EdgeDriverManager().Init();
78+
new InternetExplorerDriverManager().Init();
79+
new MarionetteDriverManager().Init();
80+
new OperaDriverManager().Init();
81+
new PhantomJsDriverManager().Init();
82+
new AppiumDriverManager().Init();
83+
84+
## Advanced
85+
86+
Configuration parameters for WebDriverManager are set in the class **constructor** parameter or **init** method parameter.
87+
88+
1. Target version can be specified in class constructor using parameter:
89+
90+
``new ChromeDriverManager("2.22").Init();``
91+
92+
In this case manager try to download ChromeDriver binary with **2.22** version.
93+
94+
2. Also you can specify target binary architecture, for this case you need to include reference and specify architecture in class constructor using paramet
95+
96+
``using WebDriverManager.Helpers;``
97+
98+
``...``
99+
100+
`` new InternetExplorerDriverManager(Architecture.x32).Init();``
101+
102+
In this case manager try to download ChromeDriver binary with **x32** architecture.
103+
104+
3. Target driver binary destination folder can be specified in class constructor using parameter:
105+
106+
``new ChromeDriverManager().Init(@"C:\Binaries");``
107+
108+
In this case manager try to download latest version of ChromeDriver and put binary to **C:\Binaries** folder.
109+
110+
NOTE 1: You can mix parameters as you want but *NOTE 2*.
111+
112+
NOTE 2: Some driver manager doesn't support version or architecture managements.
113+
114+
## About
115+
116+
WebDriverManager.Net (Copyright © 2016) is a personal project of [Alexander Rosolko] licensed under [MIT] license.
117+
Comments, questions and suggestions are always very welcome!
118+
119+
[Alexander Rosolko]: https://github.com/rosolko
120+
[WebDriverManager.Net]: https://www.nuget.org/packages/WebDriverManager
121+
[Boni García]: http://bonigarcia.github.io
122+
[GitHub Repository]: https://github.com/bonigarcia/webdrivermanager
123+
[Selenium Webdriver]: http://docs.seleniumhq.org/projects/webdriver
124+
[MIT]: https://github.com/rosolko/WebDriverManager.Net/blob/master/LICENSE

WebDriverManager/WebDriverManager.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,14 @@
6767
<Content Include="NLog.config">
6868
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
6969
</Content>
70+
<None Include="appveyor.yml" />
71+
<None Include="LICENSE" />
7072
<None Include="NLog.xsd">
7173
<SubType>Designer</SubType>
7274
</None>
7375
<None Include="packages.config" />
76+
<None Include="README.md" />
77+
<None Include="WebDriverManager.nuspec" />
7478
</ItemGroup>
7579
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
7680
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

0 commit comments

Comments
 (0)