This guide covers the most common errors faced in the Selenium WebDriver Masterclass with C#.

Use Ctrl + F, or the Table of Contents to find your issue and its solution.


Visual Studio errors

If you are using Visual Studio with C# and MsTest for your Selenium automation, you can find common Visual Studio error here.

The command “chmod + x” exited with code 9009


A project with an output Type of class library cannot be started directly


Program does not contain a static ‘Main’ method suitable for an entry point


The reference assemblies for framework “.NETFramework,Version=v4.6.1” were not found…


Skipped loading symbols. Module is optimized and the debugger option ‘Just My Code’ is enabled.


Unit tests not running in Visual Studio Test Explorer


Unit tests not showing up in Visual Studio test explorer


Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly…


An exception occurred while invoking executor ‘executor://mstestadapter/v2’ …


An exception occurred while test discoverer ‘NUnit3TestDiscoverer’ was loading tests…


System.SecurityExceptions (multiple options)


Some common errors related to Visual Studio IDE are:

  • The command “chmod + x” exited with code 9009
  • The reference assemblies for framework “.NETFramework,Version=v4.6.1” were not found
  • Unit tests not running in Visual Studio Test Explorer

Selenium C# Errors

You will find the most common Selenium WebDriver errors and the solutions to those errors. Enjoy 👍

Element is not clickable at point (X, Y). Other element would receive the click…


There is already an option for the browserVersion capability. Please use the instead.


Unable to copy file … chromedriver.exe


An exception with a null response was thrown sending an HTTP request… ConnectFailure …


An exception with a null response was thrown sending an HTTP request to the remote…


System.TypeInitializationException


System.InvalidOperationException : unknown error: Chrome version must be…


Could not copy “C… chromedriver.exe” to {some path}..


Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly… for a driver


ExpectedConditions’ is obsolete: ‘ implementation… deprecated


NoSuchElementException: no such element: Unable to locate element


All other errors

Error building sample NPM application (React Shopping cart)

Error description

Having issues building the React Shopping cart app.

Solution

In order to solve this problem, you can simply use the hosted web application instead of the local version


Where is the AutomationResources Project?

Error description

Some people are not able to find the AutomationResources project.

Solution

At first, most of you downloaded the Github projects as instructed in the lecture “How to download Github projects and open them“, If you did not, I strongly encourage you to do so. There is a folder there called AutomationResources, you should navigate to that folder and follow this path: bin->debug-> “AutomationResources.dll”.

In case there is no bin folder, open the AutomationResources in Visual Studio and build the project. This should create the AutomationResources.dll file.

At this moment, you should have created a new unit test project for Element interaction. Go to Solution Explorer of current project-> right click “References”->Navigate to “AutomationResources.dll” and import it.


System.InvalidOperationException

Error description

HResult=0x80131509

Message=unknown error: call function result missing ‘value’

(Session info: chrome=80.0.3987.163)

(Driver info: chromedriver=2.26.436362 (5476ec6bf7ccbada1734a0cdec7d570bb042aa30),platform=Windows NT 10.0.18363 x86_64)

Source=WebDriver

Solution

The ChromeDriver version needed to be updated as well as the Selenium versions.

In the future, for all students, it’s important to remember to always update to the latest ChromeDriver version in the AutomationResources project. This is the main project that will contain our ChromeDriver. All the other projects use AutomationResources‘ ChromeDriver. So only a single place to update the version of ChromeDriver 🙂

You can call that class any time like this var driver = new AutomationResources.WebDriverFactory().CreateChromeDriver();

However, keep this in mind because tomorrow Chrome can update to a new version and we will need a new ChromeDriver. If your tests stop working all of a sudden, check to see that your ChromeDriver version matches the supported Chrome version.


Summary

Hope this was helpful?

Is there an error that you need help resolving? Please comment below and I’ll try to resolve it for you.