Automation.Web.Core
2.10.0
See the version list below for details.
dotnet add package Automation.Web.Core --version 2.10.0
NuGet\Install-Package Automation.Web.Core -Version 2.10.0
<PackageReference Include="Automation.Web.Core" Version="2.10.0" />
paket add Automation.Web.Core --version 2.10.0
#r "nuget: Automation.Web.Core, 2.10.0"
// Install Automation.Web.Core as a Cake Addin #addin nuget:?package=Automation.Web.Core&version=2.10.0 // Install Automation.Web.Core as a Cake Tool #tool nuget:?package=Automation.Web.Core&version=2.10.0
Introduction
This is the web automation test library that can help use early to create an automation web test on many browsers and many OS without setup the corresponding webdriver such as ChromeDriver, FirefoxDriver or IEDriver. This library is still developing, so please keep looking. Thanks!
Releate notes
v1.x.x → v2.0.x
- Migrate to Selenium.WebDriver 4.7.x
- Integrate with Appium.WebDriver 5.x.x
- Support mobile web browsers testing on Android/iOS
- Support screen (video) recording function:
- Added the StartScreenRecording() function into IBrowser
- Added the StopScreenRecording() function into IBrowser
v2.x.x → v2.3.0
- Fix iOSBrowser to run on real device, recording screen on iOS real device
- Support Appium 2.0
- Add
DefaultBrowser
into thebrowsers.json
- Appium server is now configured at the
RemoteServer
instead ofServerUrl
v2.3.x → v2.4.x
- Add
ForceUsingDefaultBrowser
into browsers.json to force usingDefaultBrowser
in-case don't want to useExecutableBrowsers
, then only executeDefaultBrowser
instead.
- Add
v2.4.x → v2.5.x
- Add
DownloadDirectory
for IBrowser - Enable downloading in headless mode
- Add
v2.5.x → v2.6.x
- Support config
ChromeDriverExecutable
for appium chrome driver - Update
appium.webdriver
package - Add new function
ClearText
for IBrowser
- Support config
v2.6.x → v2.7.x
- Upgrade Appium.WebDriver version to "5.0.0-rc.1"
- Upgrade Selenium.WebDriver version to "4.14.1"
v2.7.x → v2.8.x
- Fix ChromeDriver issue when Chrome version > 114
v2.8.x → v2.9.x
- Add extension for IWebElement
v2.9.x → v2.10.x
- Add more extension for IWebElement such as: FindElement, FindElements, GetValue
Getting Started
- Create your test project.
- Install any unit test framework that you like. We will use NUnit in this tutorial.
- Installation the nuget package:
Automation.Web.Core
- Create a
browsers.json
file as below in your test project and set it as aContent
in theBuild action
andCopy to Output Directory
{
"ExecutableBrowsers": [ "Chrome", "Firefox" ],
"DefaultBrowser": "Chrome",
"ForceUsingDefaultBrowser": false,
"Browsers": [
{
"Id": "Android",
"Browser": "Chrome",
"Platform": "Android",
"PlatformVersion": "11.0",
"DeviceName": "Pixel5",
"AutomationName": "UIAutomator2",
"ServerUrl": "http://127.0.0.1:4723",
"IsHeadless": false,
"LogLevel": "Debug",
"Arguments": [],
"ImplicitTimeoutInSecond": 30,
"DefaultWaitTimeInSecond": 3000
},
{
"Id": "Chrome",
"Browser": "Chrome",
"Version": "Latest",
"IsHeadless": false,
"LogLevel": "Debug",
"Arguments": [],
"ImplicitTimeoutInSecond": 30,
"DefaultWaitTimeInSecond": 30
},
{
"Id": "Firefox",
"Browser": "Firefox",
"Version": "Latest",
"IsHeadless": false,
"LogLevel": "Debug",
"Arguments": [],
"ImplicitTimeoutInSecond": 30,
"DefaultWaitTimeInSecond": 30
},
{
"Id": "InternetExplorer",
"Browser": "InternetExplorer",
"Platform": "X32",
"LogLevel": "Debug",
"Arguments": [],
"ImplicitTimeoutInSecond": 30,
"DefaultWaitTimeInSecond": 30
},
{
"Id": "Edge",
"Browser": "Edge",
"Version": "Latest",
"LogLevel": "Debug",
"Arguments": [],
"ImplicitTimeoutInSecond": 30,
"DefaultWaitTimeInSecond": 30
},
{
"Id": "Safari",
"Browser": "Safari",
"LogLevel": "Debug",
"ImplicitTimeoutInSecond": 30,
"DefaultWaitTimeInSecond": 30
}
]
}
This configuration is based on your browser version & your expection browser behaviours.
- Add your test code
[TestFixtureSource(typeof(ExecutableBrowserSourceConfig))]
public class BrowserTests
{
private IBrowser browser;
private readonly string browserId;
public BrowserTests(string browserId)
{
this.browserId = browserId;
}
[SetUp]
public void SetUp()
{
browser = BrowserFactory.CreateBrowser(browserId);
//Start screen recording for evidence
//browser.StartScreenRecording();
}
[Test]
public void Test()
{
browser.Navigation.GoToUrl("https://www.google.com");
Assert.True(browser.Title.Contains("Google"));
}
[TearDown]
public virtual void TearDown()
{
//Take screenshot
string filePath = browser.TakeAndSaveScreenshot();
TestContext.AddTestAttachment(filePath);
//Stop video recording
//browser.StopScreenRecording();
//Dispose the browser
browser.Dispose();
}
}
*Note:
- The StartScreenRecording
& StopScreenRecording
functions only work when run web test on mobile device.
- To let they work also in Windows OS, please add nuget package Automation.Web.Core.Forms
https://www.nuget.org/packages/Automation.Web.Core.Forms/
Run your test cases and see the magic^^
Browser configuration details 7.1 Desktop web testing
- Currently, we support Chrome, Firefox, Safari, Edge, InternetExplorer.
7.2 Mobile web testing
- It's required to have an Appium server to run the Mobile web testing. So, please don't forget to set the
ServerUrl
to the Appium server such as http://127.0.0.1:4723.
Recommend
There is another nuget package Automation.Web.NUnit
that applying the Automation.Web.Core
with the NUnit
framework. It also supports to integrate with Specflow for BDD.
So, let try with it https://www.nuget.org/packages/Automation.Web.NUnit
APIs document
- IBrowser APIs
- The IBrowser is wrapper almost APIs from IWebDriver
- Highlight APIs:
- IBrowser.TakeAndSaveScreenshot(fileName) : take screenshot and save to local disk then return the file path.
- IBrowser.StartScreenRecording() : start screen recording video. This api supports mobile web, and windows web only.
- IBrowser.StopScreenRecording() : stop screen recording video and return the file path. This api supports mobile web, and windows web only.
browsers.json configuration file
DefaultBrowser
: default browserIdExecutableBrowsers
: a list of browserId which will be executed parallelForceUsingDefaultBrowser
: force to useDefaultBrowser
setting evenExecutableBrowsers
is being configured.
Contribute
Will update later.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Appium.WebDriver (>= 5.0.0-rc.1)
- DotNetSeleniumExtras.WaitHelpers (>= 3.11.0)
- Magick.NET-Q8-AnyCPU (>= 7.17.0)
- Microsoft.Extensions.Configuration (>= 7.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 7.0.0)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 7.0.0)
- Microsoft.Extensions.Configuration.FileExtensions (>= 7.0.0)
- Microsoft.Extensions.Configuration.Json (>= 7.0.0)
- Noksa.WebDriver.ScreenshotsExtensions (>= 0.1.5.4)
- Selenium.Support (>= 4.14.1)
- Selenium.WebDriver (>= 4.14.1)
- System.Drawing.Common (>= 7.0.0)
- WebDriverManager (>= 2.17.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Automation.Web.Core:
Package | Downloads |
---|---|
Automation.Web.NUnit
Package Description |
|
Automation.Web.Core.Forms
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.14.0-preview.299 | 46 | 11/12/2024 |
2.14.0-preview.298 | 48 | 11/12/2024 |
2.13.0 | 52 | 11/5/2024 |
2.12.0-preview.296 | 44 | 10/30/2024 |
2.12.0-preview.295 | 45 | 10/25/2024 |
2.11.2 | 60 | 10/21/2024 |
2.11.1 | 105 | 9/9/2024 |
2.11.0 | 95 | 4/29/2024 |
2.11.0-preview.290 | 203 | 12/13/2023 |
2.11.0-preview.289 | 87 | 12/13/2023 |
2.11.0-preview.288 | 76 | 12/13/2023 |
2.10.0 | 233 | 12/5/2023 |
2.10.0-preview.284 | 123 | 11/21/2023 |
2.10.0-preview.283 | 86 | 11/21/2023 |
2.9.0-preview.281 | 86 | 11/17/2023 |
2.9.0-preview.280 | 73 | 11/16/2023 |
2.9.0-preview.277 | 73 | 11/14/2023 |
2.9.0-preview.275 | 110 | 11/14/2023 |
2.8.6 | 148 | 11/6/2023 |
2.8.6-preview.272 | 83 | 11/6/2023 |
2.8.6-preview.271 | 75 | 11/6/2023 |
2.8.5 | 85 | 11/6/2023 |
2.8.5-preview.269 | 74 | 11/6/2023 |
2.8.5-preview.268 | 84 | 11/6/2023 |
2.8.3-preview.263 | 94 | 11/2/2023 |
2.8.1 | 249 | 11/2/2023 |
2.8.1-preview.258 | 96 | 11/2/2023 |
2.8.1-preview.253 | 106 | 10/31/2023 |
2.8.0-preview.252 | 97 | 10/23/2023 |
2.8.0-preview.251 | 81 | 10/23/2023 |
2.7.1-preview.250 | 78 | 10/23/2023 |
2.7.0 | 570 | 8/21/2023 |
2.6.1 | 645 | 8/1/2023 |
2.6.1-preview.246 | 92 | 7/31/2023 |
2.6.1-preview.245 | 91 | 7/31/2023 |
2.5.1 | 676 | 6/23/2023 |
2.5.1-preview.240 | 77 | 6/22/2023 |
2.5.0-preview.238 | 96 | 6/22/2023 |
2.5.0-preview.237 | 88 | 6/22/2023 |
2.5.0-preview.236 | 82 | 6/22/2023 |
2.5.0-preview.235 | 104 | 6/22/2023 |
2.4.0 | 800 | 6/21/2023 |
2.4.0-preview.228 | 77 | 6/21/2023 |
2.4.0-preview.226 | 79 | 6/21/2023 |
2.3.3-preview.225 | 82 | 6/20/2023 |
2.3.3-preview.223 | 78 | 6/20/2023 |
2.3.2-preview.222 | 76 | 6/19/2023 |
2.3.1 | 728 | 6/19/2023 |
2.3.1-preview.215 | 77 | 6/19/2023 |
2.3.0 | 648 | 6/19/2023 |
2.2.0-preview.211 | 92 | 6/7/2023 |
2.1.0-preview.186 | 406 | 1/6/2023 |
2.1.0-preview.184 | 103 | 12/27/2022 |
2.1.0-preview.183 | 105 | 12/26/2022 |
2.1.0-preview.182 | 115 | 12/26/2022 |
2.1.0-preview.181 | 96 | 12/22/2022 |
2.1.0-preview.180 | 103 | 12/22/2022 |
2.0.1 | 804 | 12/21/2022 |
2.0.0 | 1,002 | 12/21/2022 |
2.0.0-preview.173 | 100 | 12/21/2022 |
2.0.0-preview.171 | 99 | 12/21/2022 |
2.0.0-preview.169 | 95 | 12/21/2022 |
2.0.0-preview.165 | 95 | 12/19/2022 |
2.0.0-preview.161 | 102 | 12/14/2022 |
2.0.0-preview.156 | 99 | 12/14/2022 |
1.0.4-preview.131 | 287 | 5/27/2020 |
1.0.3 | 1,298 | 5/26/2020 |
1.0.3-preview.120 | 243 | 5/26/2020 |
1.0.2 | 1,127 | 5/25/2020 |
1.0.2-preview.116 | 302 | 5/25/2020 |
1.0.2-preview.114 | 307 | 5/25/2020 |
1.0.2-preview.112 | 241 | 5/22/2020 |
1.0.1 | 1,056 | 5/21/2020 |
1.0.0 | 1,305 | 5/18/2020 |