Integration testing framework for developers. TestR allows automating testing of web and desktop applications. Currently we are supporting Internet Explorer, Chrome, Edge (chromium based) and Firefox*.

Minimal requirement for setup. Simply reference the TestR nuget then make some minor configuration for some browsers (firefox).

To install TestR, run one of the following command in the "Package Manager Console".

Install-Package TestR

Searching Bing using Internet Explorer

using (var browser = InternetExplorerBrowser.AttachOrCreate())
{
	browser.NavigateTo("http://bing.com");
	browser.Elements.TextInputs["sb_form_q"].TypeText("Bobby Cannon");
	browser.Elements["sb_form_go"].Click();
	browser.WaitForRedirect();
}

Searching Amazon using Chrome

using (var browser = ChromeBrowser.AttachOrCreate()) 
{
	browser.NavigateTo("http://amazon.com");
	browser.Elements.TextInputs["twotabsearchtextbox"].TypeText("protein powder");
	browser.Elements.First(x => x.GetAttributeValue("title") == "Go").Click();
	browser.WaitForRedirect();
}

Same example using FireFox (see configuring firefox below)

using (var browser = FirefoxBrowser.AttachOrCreate()) 
{
	browser.NavigateTo("http://amazon.com");
	browser.Elements.TextInputs["twotabsearchtextbox"].TypeText("protein powder");
	browser.Elements.First(x => x.GetAttributeValue("title") == "Go").Click();
	browser.WaitForRedirect();
}

This example shows you how to use the "TypeText" method. Use this method to type into an element by adding the text you want into the parameter.

using (var browser = InternetExplorer.AttachOrCreate()) 
{
	browser.NavigateTo("http://bing.com");
	browser.First("sb_form_q").TypeText("Become Epic");
}

This example shows you how to use the "Click" method. Use this method to Click an element.

using (var browser = InternetExplorer.AttachOrCreate()) 
{
	browser.NavigateTo("http://bing.com");
	browser.First("sb_form_q").TypeText("Become Epic");
	browser.First("sb_form_go").Click();
}

Coming Soon More element attributes. More specific element implementation with their unique attributes.

Configuring Firefox

Firefox is the only browser that requires external configuration. The instruction below will help you configure Firefox for remote debugging (aka automation).

  • Start Firefox
  • Press F12 to open the dev tools
  • Press F1 to show settings
  • In the bottom left check the following values
    • Enable browser chrome and add-on debugging toolboxes
    • Enable remote debugging
  • Go to the "about:config" page
  • Filter by "prompt-connection"
  • Turn off "devtools.debugger.prompt-connection" by setting the value to false
Known Issues
  • Do not use TestR in an MTA thread, you must be on a STA thread.
  • Internet Explorer will fail if you cross security boundaries like going from Internet to Intranet sites.
  • Firefox must be configured to allow debugger access.
Archived Known Issues (really old)

These are really old issue that will probable not affect you unless you are running old outdated systems.

  • IMPORTANT: KB3025390 an Update for IE 11 for Windows 8.1 will cause TestR to stop working. You'll need to remove this update to allow TestR to work properly.
    • Special thanks to Gerald Fishel and Michael Bergerman for all their help in notifying me of the issue and finding the issue.
  • In Windows 10 the new Cortana feature may delay (~60 seconds) enumeration of controls. Disable Cortana to remove the delay. See more information about the issue here.