Skip to content

Commit fefb841

Browse files
committed
Initial code commit
0 parents  commit fefb841

21 files changed

+4027
-0
lines changed

.gitignore

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.suo
6+
*.user
7+
*.userosscache
8+
*.sln.docstates
9+
10+
# User-specific files (MonoDevelop/Xamarin Studio)
11+
*.userprefs
12+
13+
# Build results
14+
[Dd]ebug/
15+
[Dd]ebugPublic/
16+
[Rr]elease/
17+
[Rr]eleases/
18+
x64/
19+
x86/
20+
bld/
21+
[Bb]in/
22+
[Oo]bj/
23+
24+
# Visual Studio 2015 cache/options directory
25+
.vs/
26+
# Uncomment if you have tasks that create the project's static files in wwwroot
27+
#wwwroot/
28+
29+
# MSTest test Results
30+
[Tt]est[Rr]esult*/
31+
[Bb]uild[Ll]og.*
32+
33+
# NUNIT
34+
*.VisualState.xml
35+
TestResult.xml
36+
37+
# Build Results of an ATL Project
38+
[Dd]ebugPS/
39+
[Rr]eleasePS/
40+
dlldata.c
41+
42+
# DNX
43+
project.lock.json
44+
artifacts/
45+
46+
*_i.c
47+
*_p.c
48+
*_i.h
49+
*.ilk
50+
*.meta
51+
*.obj
52+
*.pch
53+
*.pdb
54+
*.pgc
55+
*.pgd
56+
*.rsp
57+
*.sbr
58+
*.tlb
59+
*.tli
60+
*.tlh
61+
*.tmp
62+
*.tmp_proj
63+
*.log
64+
*.vspscc
65+
*.vssscc
66+
.builds
67+
*.pidb
68+
*.svclog
69+
*.scc
70+
71+
# Chutzpah Test files
72+
_Chutzpah*
73+
74+
# Visual C++ cache files
75+
ipch/
76+
*.aps
77+
*.ncb
78+
*.opendb
79+
*.opensdf
80+
*.sdf
81+
*.cachefile
82+
83+
# Visual Studio profiler
84+
*.psess
85+
*.vsp
86+
*.vspx
87+
*.sap
88+
89+
# TFS 2012 Local Workspace
90+
$tf/
91+
92+
# Guidance Automation Toolkit
93+
*.gpState
94+
95+
# ReSharper is a .NET coding add-in
96+
_ReSharper*/
97+
*.[Rr]e[Ss]harper
98+
*.DotSettings.user
99+
100+
# JustCode is a .NET coding add-in
101+
.JustCode
102+
103+
# TeamCity is a build add-in
104+
_TeamCity*
105+
106+
# DotCover is a Code Coverage Tool
107+
*.dotCover
108+
109+
# NCrunch
110+
_NCrunch_*
111+
.*crunch*.local.xml
112+
nCrunchTemp_*
113+
114+
# MightyMoose
115+
*.mm.*
116+
AutoTest.Net/
117+
118+
# Web workbench (sass)
119+
.sass-cache/
120+
121+
# Installshield output folder
122+
[Ee]xpress/
123+
124+
# DocProject is a documentation generator add-in
125+
DocProject/buildhelp/
126+
DocProject/Help/*.HxT
127+
DocProject/Help/*.HxC
128+
DocProject/Help/*.hhc
129+
DocProject/Help/*.hhk
130+
DocProject/Help/*.hhp
131+
DocProject/Help/Html2
132+
DocProject/Help/html
133+
134+
# Click-Once directory
135+
publish/
136+
137+
# Publish Web Output
138+
*.[Pp]ublish.xml
139+
*.azurePubxml
140+
# TODO: Comment the next line if you want to checkin your web deploy settings
141+
# but database connection strings (with potential passwords) will be unencrypted
142+
*.pubxml
143+
*.publishproj
144+
145+
# NuGet Packages
146+
*.nupkg
147+
# The packages folder can be ignored because of Package Restore
148+
**/packages/*
149+
# except build/, which is used as an MSBuild target.
150+
!**/packages/build/
151+
# Uncomment if necessary however generally it will be regenerated when needed
152+
#!**/packages/repositories.config
153+
# NuGet v3's project.json files produces more ignoreable files
154+
*.nuget.props
155+
*.nuget.targets
156+
157+
# Microsoft Azure Build Output
158+
csx/
159+
*.build.csdef
160+
161+
# Microsoft Azure Emulator
162+
ecf/
163+
rcf/
164+
165+
# Microsoft Azure ApplicationInsights config file
166+
ApplicationInsights.config
167+
168+
# Windows Store app package directory
169+
AppPackages/
170+
BundleArtifacts/
171+
172+
# Visual Studio cache files
173+
# files ending in .cache can be ignored
174+
*.[Cc]ache
175+
# but keep track of directories ending in .cache
176+
!*.[Cc]ache/
177+
178+
# Others
179+
ClientBin/
180+
~$*
181+
*~
182+
*.dbmdl
183+
*.dbproj.schemaview
184+
*.pfx
185+
*.publishsettings
186+
node_modules/
187+
orleans.codegen.cs
188+
189+
# RIA/Silverlight projects
190+
Generated_Code/
191+
192+
# Backup & report files from converting an old project file
193+
# to a newer Visual Studio version. Backup files are not needed,
194+
# because we have git ;-)
195+
_UpgradeReport_Files/
196+
Backup*/
197+
UpgradeLog*.XML
198+
UpgradeLog*.htm
199+
200+
# SQL Server files
201+
*.mdf
202+
*.ldf
203+
204+
# Business Intelligence projects
205+
*.rdl.data
206+
*.bim.layout
207+
*.bim_*.settings
208+
209+
# Microsoft Fakes
210+
FakesAssemblies/
211+
212+
# GhostDoc plugin setting file
213+
*.GhostDoc.xml
214+
215+
# Node.js Tools for Visual Studio
216+
.ntvs_analysis.dat
217+
218+
# Visual Studio 6 build log
219+
*.plg
220+
221+
# Visual Studio 6 workspace options file
222+
*.opt
223+
224+
# Visual Studio LightSwitch build output
225+
**/*.HTMLClient/GeneratedArtifacts
226+
**/*.DesktopClient/GeneratedArtifacts
227+
**/*.DesktopClient/ModelManifest.xml
228+
**/*.Server/GeneratedArtifacts
229+
**/*.Server/ModelManifest.xml
230+
_Pvt_Extensions
231+
232+
# Paket dependency manager
233+
.paket/paket.exe
234+
235+
# FAKE - F# Make
236+
.fake/

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.

README.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# WebDriverManager.Net
2+
Automatic Selenium WebDriver binaries management for .Net
3+
4+
Original application idea is going from - [Boni García].
5+
Java implementation you can find here - [GitHub Repository].
6+
7+
This piece of software is a small library aimed to automate the [Selenium WebDriver] binaries management inside a .Net project.
8+
9+
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**, or **Marionette**) you need to download a binary which allows WebDriver to handle the browser.
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).
11+
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.
13+
14+
WebDriverManager is open source, released under the terms of [MIT] license.
15+
16+
## Installation
17+
18+
[WebDriverManager.Net] can be downloaded from NuGet.
19+
Use the GUI or the following command in the Package Manager Console:
20+
21+
PM> Install-Package WebDriverManager.Net
22+
23+
## Usage
24+
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:
26+
27+
namespace BrowserTests
28+
{
29+
using OpenQA.Selenium;
30+
using OpenQA.Selenium.Chrome;
31+
using WebDriverManager.BrowserManagers;
32+
33+
[TestFixture]
34+
public class ChromeTest
35+
{
36+
protected IWebDriver driver;
37+
38+
[TestFixtureSetUp]
39+
public void FixtureSetUp()
40+
{
41+
new ChromeDriverManager().Init();
42+
}
43+
44+
[SetUp]
45+
public void TestSetUp()
46+
{
47+
driver = new ChromeDriver();
48+
}
49+
50+
[TestFixtureTearDown]
51+
public void teardown()
52+
{
53+
if (driver != null)
54+
driver.Quit();
55+
}
56+
57+
[Test]
58+
public void Test() {
59+
// Using Selenium WebDriver to carry out automated web testing
60+
}
61+
}
62+
}
63+
64+
Notice that simple adding ``new ChromeDriverManager().Init();`` WebDriverManager does magic for you:
65+
66+
1. It checks the latest version of the WebDriver binary file
67+
2. It downloads the binary WebDriver if it is not present in your system
68+
69+
So far, WebDriverManager supports **Chrome**, **Microsoft Edge**, **Internet Explorer**, **Marionette**, **Opera** or **PhantomJS** as follows:
70+
71+
new ChromeDriverManager().Init();
72+
new EdgeDriverManager().Init();
73+
new InternetExplorerDriverManager().Init();
74+
new MarionetteDriverManager().Init();
75+
new OperaDriverManager().Init();
76+
new PhantomJsDriverManager().Init();
77+
78+
## Advanced
79+
80+
Configuration parameters for WebDriverManager are set in the class **constructor** parameter or **init** method parameter.
81+
82+
1. Target version can be specified in class constructor using parameter:
83+
84+
``new ChromeDriverManager("2.21").Init();``
85+
86+
In this case manager try to download ChromeDriver binary with **2.11** version.
87+
88+
2. Also you can specify target binary architecture, for this case you need to include reference and specify architecture in class constructor using paramet
89+
90+
``using WebDriverManager.Helpers;``
91+
92+
``...``
93+
94+
`` new InternetExplorerDriverManager(Architecture.x32).Init();``
95+
96+
In this case manager try to download ChromeDriver binary with **x32** architecture.
97+
98+
3. Target driver binary destination folder can be specified in class constructor using parameter:
99+
100+
``new ChromeDriverManager().Init(@"C:\Binaries");``
101+
102+
In this case manager try to download latest version of ChromeDriver and put binary to **C:\Binaries** folder.
103+
104+
NOTE 1: You can mix parameters as you want but *NOTE 2*.
105+
106+
NOTE 2: Some driver manager doesn't support vesion or architecture managements.
107+
108+
## About
109+
110+
WebDriverManager.Net (Copyright © 2016) is a personal project of [Alexander Rosolko] licensed under [MIT] license.
111+
Comments, questions and suggestions are always very welcome!
112+
113+
[Alexander Rosolko]: https://github.com/rosolko
114+
[WebDriverManager.Net]: https://www.nuget.org/packages
115+
[Boni García]: http://bonigarcia.github.io
116+
[GitHub Repository]: https://github.com/bonigarcia/webdrivermanager
117+
[Selenium Webdriver]: http://docs.seleniumhq.org/projects/webdriver
118+
[MIT]: https://github.com/rosolko/WebDriverManager.Net/blob/master/LICENSE

0 commit comments

Comments
 (0)