Test on Internal Networks
Run MBUnit tests on your privately hosted websites using BrowserStack Automate
BrowserStack enables you to run your MBUnit automated tests on your internal development environments, on localhost, and from behind a corporate firewall. This feature is called “Local Testing”.
Local Testing establishes a secure connection between your machine and the BrowserStack cloud. Once you set up Local Testing, all URLs work out of the box, including HTTPS URLs and those behind a proxy or firewall.
Configuring your MBUnit tests for Local Testing takes just few simple steps:
-
Download and install the
BrowserStack Local
binary using NuGet Gallery: -
Next, you need to update your MBUnit config file,
App.config
, and set thebrowserstack.local
capability totrue
:<?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <sectionGroup name="capabilities"> <section name="local" type="System.Configuration.AppSettingsSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </sectionGroup> <sectionGroup name="environments"> <section name="chrome" type="System.Configuration.AppSettingsSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </sectionGroup> </configSections> <appSettings> <add key="user" value="YOUR_USERNAME" /> <add key="key" value="YOUR_ACCESS_KEY" /> <add key="server" value="hub-cloud.browserstack.com" /> </appSettings> <capabilities> <local> <add key="browserstack.local" value="true" /> </local> </capabilities> <environments> <chrome> <add key="browser" value="chrome" /> </chrome> </environments> </configuration>
-
Run a sample test case to check whether the Local test connection has been set up properly. You can use the following sample test case, which can be found in the repo under
mbunit-browserstack/MBUnit-BrowserStack/
directory:LocalTest.cs[TestFixture] public class LocalTest : BrowserStackMBUnitTest { public LocalTest() : base("local", "chrome") { } [Test] public void HealthCheck() { driver.Navigate().GoToUrl("http://bs-local.com:45691/check"); Assert.IsTrue(Regex.IsMatch(driver.PageSource, "Up and running", RegexOptions.IgnoreCase)); } }
-
You can now run your MBUnit test using BrowserStack Local with the following steps:
- Build the solution in Visual Studio
- Run test with fixture
local
from Test Explorer
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!