Disable Firefox insecure password warning when testing with Selenium

If you use Selenium and Firefox version 52 or higher for testing your UI and your development site does not use SSL, then you will get the following warning when entering passwords on your login page “This connection is not secure. Logins entered here could be compromised”

Firefox will also open the URL https://support.mozilla.org/en-US/kb/insecure-password-warning-firefox?as=u&utm_source=inproduct in a new tab which takes the focus away from the page you are testing.

This is a great feature and will hopefully stop some users from giving away their passwords over insecure connections. However if you are a developer/tester this is a very annoying feature and breaks your Selenium/Firefox tests during the development phase.

You can stop this warning and the new tab opening by changing the Firefox preference security.insecure_field_warning.contextual.enabled to false

I am using C# to run my tests so my code for setting up the Firefox driver looks something like this:


// Firefox driver setup
FirefoxProfile profile = new FirefoxProfile();
profile.SetPreference("security.insecure_field_warning.contextual.enabled", false); // disable insecure password warning
IWebDriver driver = new FirefoxDriver(profile);

// more test code

Where is the Visual Studio 2017 MSBuild.exe?

If you have installed Visual Studio 2017 and need to use the latest MSBuild.exe CLI you may have discovered that it is no longer installed in %programfiles(x86)%\MSBuild\15.0\Bin\msbuild.exe

MSBuild.exe can now be found in %programfiles(x86)%\Microsoft Visual Studio\2017\<version_name>\MSBuild\15.0\Bin\msbuild.exe

Note that the <version_name> [Community|Professional|Enterprise] is now part of the path above.

Visual Studio 2015 Error Opening .cshtml File

PROBLEM

You double-click a .cshtml file in Visual Studio 2015 and you get an error “Object reference not set to an instance of an object”.

SOLUTION

  1. Close Visual Studio
  2. Delete all files in the folder %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
  3. Re-open Visual Studio
  4. You should now be able to open your .cshtml file

Visual Studio 2012 SharePoint .csproj Unsupported

I have run into this a few times now and I keep forgetting how to fix it, so it is time to document the solution.

PROBLEM

I install Visual Studio 2012 on a machine, connect to TFS and get latest on some SharePoint projects. I open the SharePoint project and get the following error message:

“These projects are either not supported or need project behavior impacting modifications to open in this version of Visual Studio. Projects not displayed either require no changes or will automatically be modified such that behavior is not impacted.

Unsupported
This version of Visual Studio does not have the following project types installed or does not support them. You can still open these projects in the version of Visual Studio in which they were originally created. For details, see More information.”

unsupportedproject01

And my first reaction is What do you mean you don’t support .csproj files. Those files were invented for you. If you don’t recognize them who will?

So then I the scour the Interweb come up with a bunch of useless suggestions about how I should run Devenv.exe /ResetSkipPkgs or better still uninstall Visual Studio, turn off the computer, wait 30 seconds, turn it on again, install Visual Studio, etc.

The solution shown below is simpler and doesn’t harm any humans in the process.

SOLUTION

The solution to this madness is to install the Office Developer Tools for Visual Studio 2012.

Open up the Web Platform Installer and if you don’t have it installed download and install it. Search for Office Developer Tools and install it.

unsupportedproject02

For some reason I never remember to do this, now if I can just remember that I wrote this article I won’t waste another hour of my life.