https://github.com/ukho/uiautomationframework
The automation framework is intended to help automate the browser for automated tests. It's intended to work with SpecFlow, and by default uses Selenium as the web driver.
https://github.com/ukho/uiautomationframework
chrome chromedriver selenium specflow specflow3
Last synced: 4 months ago
JSON representation
The automation framework is intended to help automate the browser for automated tests. It's intended to work with SpecFlow, and by default uses Selenium as the web driver.
- Host: GitHub
- URL: https://github.com/ukho/uiautomationframework
- Owner: UKHO
- License: mit
- Created: 2019-08-01T09:02:08.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-02-21T08:46:00.000Z (over 1 year ago)
- Last Synced: 2025-08-01T07:03:31.333Z (11 months ago)
- Topics: chrome, chromedriver, selenium, specflow, specflow3
- Language: C#
- Homepage:
- Size: 2.16 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
[](https://ukhogov.visualstudio.com/Pipelines/_build/latest?definitionId=101&branchName=master)
# UKHO Browser Automation Framework
The automation framework is intended to help automate the browser for automated tests. It's intended to work with SpecFlow, and by default uses Selenium as the web driver.
## Quick Start Guide
Include the NuGet package in your SpecFlow project:
```powershell
Install-Package UKHO.UIAutomationFramework
```
You then need to ensure SpecFlow is looking in the framework assembly for bindings. Ensure it’s added to the spec projects App.config:
```xml
```
You specify a number of other settings in the app config for the base URL, etc:
```xml
```
These settings are as follows:
| Setting | Value |
|---------|--------|
| BaseAddress | This is where the browser will start |
| Browser | This is the browser that the |
You then need to provide a session factory and register it with SpecFlow’s DI:
```C#
internal class FMSessionFactory : ISessionFactory
{
public BaseSession CreateSession(string testTitle)
{
var fmSession = new FMSession(testTitle);
fmSession.WebDriver.WindowSize = new Size(1280, 1024);
return fmSession;
}
}
[Binding]
// ReSharper disable once InconsistentNaming
public class FMWebDriverSupport
{
private readonly IObjectContainer objectContainer;
public FMWebDriverSupport(IObjectContainer objectContainer)
{
this.objectContainer = objectContainer;
}
[BeforeScenario]
public void InitializeWebDriver()
{
var sessionInstance = new FMSessionFactory();
objectContainer.RegisterInstanceAs(sessionInstance);
}
public static string BaseUrl => ConfigurationManager.AppSettings["BaseAddress"];
}
```
Once you’ve done this, you should be able to inject ```ISession``` into any page object model and work with it.
e.g. (NB, I’ve copied a subset, compiler will tell you if you need to implement more methods).
```C#
public class RecoverPasswordPage : PageBase
{
private readonly ISession session;
public RecoverPasswordPage(ISession session)
: base(session)
{
}
protected override string PageId => "MasterBody";
protected override string ExpectedPageTitle => "Recover your password";
public override void GoTo()
{
throw new NotImplementedException();// How to get to the page, e.g. Session.WebDriver.GoToUrl("~/Catalog/Geo"); Usually, not required
}
public bool ValidatePasswordPage()
{
return IsAt;
}
}
```
## Security Disclosure
The UK Hydrographic Office (UKHO) collects and supplies hydrographic and geospatial data for the merchant shipping and the Royal Navy, to protect lives at sea. Maintaining the confidentially, integrity and availability of our services is paramount. Found a security bug? You might be saving a life by reporting it to us at UKHO-ITSO@ukho.gov.uk