Selenium errors can be very annoying. Right?
Sometimes we spend hours or even days troubleshooting problems.. Ugh!
So I’ve compiled a post on the most common Selenium errors that my students and I encountered.
I also supplied information on how to fix these errors.
Table of Contents
- 1 Debug and questions
- 2 Selenium errors
- 2.1 A project with an output Type of class library cannot be started directly
- 2.2 There is already an option for the browserVersion capability. Please use the instead.
- 2.3 Program does not contain a static ‘Main’ method suitable for an entry point
- 2.4 Unable to copy file … chromedriver.exe
- 2.5 An exception occurred while test discoverer ‘NUnit3TestDiscoverer’ was loading tests…
- 2.6 A exception with a null response was thrown sending an HTTP request… ConnectFailure …
- 2.7 A exception with a null response was thrown sending an HTTP request to the remote…
- 2.8 Cannot find Firefox binary in PATH …
- 2.9 System.SecurityExceptions (multiple options)
- 2.10 System.TypeInitializationException
- 2.11 An exception occurred while invoking executor ‘executor://mstestadapter/v2’ …
- 2.12 System.InvalidOperationException : unknown error: Chrome version must be…
- 2.13 Issues with Firefox and Selenium 3.0 Compatibility
- 2.14 Element is not clickable at point (X, Y). Other element would receive the click…
- 2.15 Unit tests not showing up in Visual Studio test explorer
- 2.16 Unit tests not running in Visual Studio Test Explorer
- 2.17 OpenQA.Selenium.WebDriverException: Unexpected error. {“status”: 9,”value”: {“id”: “UnknownCommand” …
- 3 Common Selenium Warnings
Debug and questions
How to debug your errors and be self sufficient?
Watch this quick video
How can I ask you a question?
Provide me with a SSCCE question in the comments below. I respond daily.
Selenium errors
A project with an output Type of class library cannot be started directly
Error Message
A project with an output Type of class library cannot be started directly. In order to debug this project, add an executable project to this solution which references the library project. Set the executable project as the startup project.

Project with an output type of class library
The Problem
The problem is that you create a project as a type “Class Library” or “Unit Test Project” and are attempting to execute this project using the key F5, which means “Run”. You cannot run these types of projects in this manner. A unit test project must be executed using the Test Explorer of Visual Studio.
The Solution
Option 1
In your IDE, go to Test > Windows > Test Explorer. This will open up the Test Explorer. Right click the name of your unit test and then select “Run Selected Tests”.
Option 2
Place the cursor inside of your test method. Press Ctrl + R, T. This will run the test that has the cursor.
This free C# course will teach you how to correctly run the different kinds of projects.
[bctt tweet=”I fixed my #Selenium error using this post https://wp.me/p7absY-4E” username=”Nikolay_A00″]
There is already an option for the browserVersion capability. Please use the instead.
Error Message
System.ArgumentException: ‘There is already an option for the browserVersion capability. Please use the instead.
Parameter name: capabilityName’
The Problem
With the introduction of the W3C spec, there will be changes to the DriverOptions.cs from Selenium. This means that the old way of setting the ChromeOptions or DesiredCapabilities will no longer be possible. So this will be a new way to make this happen.
The Solution
Set your DriverOptions through properties instead of passing in strings into the AddAdditionalCapability()
Here’s a code sample for C#:
Program does not contain a static ‘Main’ method suitable for an entry point
Error Message
Program does not contain a static ‘Main’ method suitable for an entry point
The Solution
Same solution as this error “A project with an output Type of class library cannot be started directly”
Unable to copy file … chromedriver.exe
Error Message
Severity Code Description Project File Line Suppression State
Error Unable to copy file “C:\Users\User\Documents\Visual Studio 2015\Projects\UnitTestProject5\UnitTestProject5\chromedriver.exe” to “bin\Debug\chromedriver.exe
InnerException
The process cannot access the file ‘bin\Debug\chromedriver.exe’ because it is being used by another process
The Problem
The problem here is that your ChromeDriver is being used by another process. So when it’s trying to be copied, it can’t because it’s being used.
The Solution
Option A
- Open Task Manager and kill all chromedriver.exe processes
Option B
- Open Powershell command line.
- Execute command: Get-Process chromedriver | Stop-process
- This will kill all processes at once
An exception occurred while test discoverer ‘NUnit3TestDiscoverer’ was loading tests…
Error Message
An exception occurred while test discoverer ‘NUnit3TestDiscoverer’ was loading tests. Exception: Could not load file or assembly ‘nunit.engine’
The Problem
A caching issue with NUnit
The Solution
In this bug to NUnit, lorenh provides the solution about how to delete your cache.
A exception with a null response was thrown sending an HTTP request… ConnectFailure …
Error Message
A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL http://localhost:19409/session/7114d633a2adbc5105f3f6c7abc7c596/url. The status of the exception was ConnectFailure, and the message was: Unable to connect to the remote server
InnerException
Unable to connect to the remote server
The Problem
Compatibility of Selenium WebDriver with a browser is the culprit here. This is the largest burden in my behind, and has been for years now…
This will probably continue until Selenium WebDriver is a W3C standard that is integrated into each browser. Until then, we will keep having these issues.
This error occurred to me with:
- Chrome 55,56
- ChromeDriver 2.27
- Selenium WebDriver 3.0.1
The Solution
- Use ChromeDriver for all your test automation practice. Until I tell you it’s okay to use other Drivers.
- Make sure that your Chrome Browser and your ChromeDriver version are compatible.
- You can see this information on the ChromeDriver download page
How to tell if ChromeDriver is compatible with Chrome Browser
- You can see this information on the ChromeDriver download page
- Upgrade your Chrome and your ChromeDriver if you must
- Warning: It’s almost impossible to downgrade ChromeDriver, so don’t try
- Download the latest Selenium WebDriver API Nuget package
- Rebuild your whole solution with all of these new resources
- Try to run your tests again
- If this doesn’t work, restart your computer and try again.
[bctt tweet=”I encountered “a exceptions with null response” in my #Selenium code and fixed it using this post https://wp.me/p7absY-4E” username=”Nikolay_A00″]
A exception with a null response was thrown sending an HTTP request to the remote…
Error Message
Similar to the error above, but it’s slightly different in wording and message.
Selenium.WebDriverException: ‘A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL http://localhost:25675/session. The status of the exception was ReceiveFailure, and the message was: The underlying connection was closed: An unexpected error occurred on a receive.’
InnerException
Unable to connect to the remote server
The Problem
You may have noticed that this page has one trend. Compatibility of Selenium WebDriver with a browser. This the largest burden in many of my behind, and has been for years now. This will probably continue until Selenium WebDriver is a W3C standard that is integrated into each browser. Until then, we will keep having these issues.
This error occurred to me with:
- Chrome 56
- ChromeDriver 2.27
- Selenium WebDriver 3.0.1.0
The Solution
- Update your Chrome browser to version 57.0
- This did the trick for me. Keep in mind that maybe your versions of browser and ChromeDriver may be different. However, if you receive this error, just upgrade your browser until it fits into the support matrix of ChromeDriver release logs.
Cannot find Firefox binary in PATH …
Error Message
OpenQA.Selenium.WebDriverException: Cannot find Firefox binary in PATH or default install locations. Make sure Firefox is installed. OS appears to be: Vista
The Problem
The Selenium Webdriver team is making updates to Selenium to prepare it for Selenium 3.0. Also, the Mozilla team is making changes to the Firefox architecture to support the in built capabilities for Selenium Webdriver. Therefore, working with the latest versions of Selenium Webdriver and Firefox is going to cause you some issues. At least for the next few months. I believe that a stable 3.0 version will be released by Christmas.
The Solution
You can use the versions that I show in the Complete Selenium Webdriver Course:
- Selenium Webdriver v 2.51.0 – just be sure to select this version in Nuget Package Manager when downloading
- Firefox v 39.0
With the above installed, everything in this course for you should work without problems.
System.SecurityExceptions (multiple options)
Error Message
Almost any error message that contains SecurityException or something being “Inaccessible”
Here is a specific example that deals with NLog:
Error Error initializing target ‘EventLog Target[eventlog_wrapped]’. Exception: System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.
at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly, Boolean wantToCreate)
at System.Diagnostics.EventLog._InternalLogNameFromSourceName(String source, String machineName)
at System.Diagnostics.EventLog.LogNameFromSourceName(String source, String machineName)
at NLog.Targets.EventLogTarget.InitializeTarget()
at NLog.Targets.Target.Initialize(LoggingConfiguration configuration)
The Zone of the assembly that failed was:
MyComputer
The Problem
It’s stupid if you ask me, but a certainly recurring problem…
For whatever reason, Visual Studio sometimes requires you to start it as an Administrator. I believe this is after first installation or any kind of modification to Visual Studio.
The Solution
- Right click your Visual Studio icon
- Select “Run as administrator”
- Perform whatever operation you were previously trying to perform.
- The error should now be fixed
PS. You don’t need to keep running it as Administrator after this. At least it’s a one time action.
System.TypeInitializationException
System.TypeInitializationException: System.TypeInitializationException: The type initializer for ‘Framework.Browser’ threw an exception. —> OpenQA.Selenium.WebDriverException: Failed to start up socket within 45000 ms. Attempted to connect to the following addresses: 127.0.0.1:7055.
Or something like this?
OpenQA.Selenium.WebDriverException : Unexpected error. System.Net.WebException: Unable to connect to the remote server —> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
Today is your lucky day because I am going to help you resolve these really annoying errors!
The Problem
The problem is a standard compatibility issue between Selenium WebDriver and your version of a browser. As I am writing about this, the latest WebDriver version is 2.53.1. The latest Chrome version is 51.0 and the latest Firefox version is 46.0. Therefore, the Selenium WebDriver API does not get updated as often as Chrome or Firefox.
When different types of browsers such as Chrome or Firefox get updated, there is a chance that this update will break the Selenium API.
In our industry, this is known as a regression. Therefore, when you get the latest version of your browser, you may be using a Selenium WebDriver version that does not support the latest features of that browser. At this point, you will receive an ugly error that looks like this:
System.TypeInitializationException
Now, you will spend the next day wondering how your Selenium code used to work yesterday and today it just stopped working.
The Solution
Downgrade your appropriate browser to the version supported by the latest Selenium Driver. This might be Firefox, ChromeDriver, IEDriver and so on.
In this example I teach you how to downgrade Firefox.
An exception occurred while invoking executor ‘executor://mstestadapter/v2’ …
Error Message
This message is in your Output pane in “Output from Tests”.
An exception occurred while invoking executor ‘executor://mstestadapter/v2’: Constructor on type ‘Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.UnitTestRunner’ not found.
The Symptoms
You are trying to run your Automation tests using MSTest, but they don’t run. They start going, but then Visual Studio just stops. When you check the Output pane, you see the message described above.
MSTest has a bug and needs an update. I had version 1.1.11 installed and it caused me this issue.
The Solution
- Using NuGet Package manager, update your MSTest.TestAdapter and MSTest.TestFramework NuGet packages to the latest version. I updated to 1.1.18.
- Restart Visual Studio
- Re-run your automation tests
System.InvalidOperationException : unknown error: Chrome version must be…
Error Message
System.InvalidOperationException : unknown error: Chrome version must be >= 54.0.2840.0
The Problem
Another issue with compatibility of ChromeDriver with Chrome Browser. In this case it was Chrome version 48.0 not working with ChromeDriver version 2.27
The Solution
Upgrade your Chrome browser to the version supported by ChromeDriver. For example, ChromeDriver 2.27 supports Chrome 54 – 56 according to their release notes.
Issues with Firefox and Selenium 3.0 Compatibility
Error Message
Nothing specific, if you see weirdness with Firefox and Selenium 3.0, this solution will probably work for you
The Problem
The #1 problem that people complain about is that their Firefox Driver doesn’t work with Selenium 3.0. I get this question about 72 times per day. Let me help.
The Selenium Webdriver team released Selenium 3.0. However, the Mozilla team is making changes to the Firefox architecture to support the in built capabilities for Selenium Webdriver. Therefore, working with the latest versions of Selenium Webdriver and Firefox is going to cause you some issues until the Firefox team finishes implementing Gecko Driver. By the way, you won’t be using Firefox driver any more.
The Solution
If you are starting to use Selenium Webdriver, your easiest route is to start by using Chrome Driver. You can use the latest version of Selenium and the latest version of Chrome Driver.
Don’t touch Gecko Driver (replacement of FirefoxDriver) until it is more mature. Otherwise, you’re bound to cause yourself problems.
Element is not clickable at point (X, Y). Other element would receive the click…
Error Message
System.InvalidOperationException : unknown error: Element is not clickable at point (111, 700). Other element would receive the click: <div class=”et_social_heading”>…</div> (Session info: chrome=45.0.2454.93) (Driver info: chromedriver=2.15.322448 (52179c1b310fec1797c81ea9a20326839860b7d3),platform=Windows NT 6.1 SP1 x86_64)
The Problem
The problem here is that the element that you are trying to click is either covered by another element, or simply not visible. Here is an example. If you go to www.ultimateqa.com and try to click the Start Here button when you are a bit scrolled down, the header covers up the button. As a result, even though the button is on the page, it is not clickable because the header is covering it up.

Element not clickable example
The Solution
To fix this problem, you need to make the element visible. Specifically, Selenium tries to click on the exact center of the element. Your options are to scroll up, or hover over an element to close it, or minimize an expanded element. Simply put, make sure that your element is visible for clicking. The center of the element that you want to interact with should not be obstructed by another element.
You can scroll the element into view like this:
Or you can use the actions class to move to element before interacting with it like this:
Unit tests not showing up in Visual Studio test explorer
Error Message
Something like this below:
…\MSTest.TestAdapter.1.2.0/build/_common/Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll
The Problem
- Visual Studio Version: 15.0.X
- MSTest Adapter version: 1.18
There seems to a be bug with Visual Studio and the Visual Studio test adapter when you are trying to work with the versions listed above.
The Solution
To fix this problem, you need to update Visual Studio to version 15.5.2 and your MSTest Adapter in the Nuget package manager to version 1.2.0.
[bctt tweet=”Are your #Selenium #automation tests not showing up in the Visual Studio Test Explorer? Here is the fix https://wp.me/p7absY-4E” username=”Nikolay_A00″]
Unit tests not running in Visual Studio Test Explorer
Error messages
UTA031: class … does not have valid TestContext property. TestContext must be of type TestContext, must be non-static, public and must not be read-only. For example: public TestContext TestContext.
If you are using the MStest unit testing framework, make sure that your TestContext property follows the specifications listed in the message. Meaning non-static, public and must not be read-only.
It should look like this:
OpenQA.Selenium.WebDriverException: Unexpected error. {“status”: 9,”value”: {“id”: “UnknownCommand” …
Error messages
OpenQA.Selenium.WebDriverException: Unexpected error. { “status”: 9, “value”: { “id”: “UnknownCommand”, “error”: “unknown command”, “message”: “The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource.” }}
Programming Languages
Java, C#
The problem
Common Selenium Warnings
ExpectedConditions’ is obsolete: ‘ implementation… deprecated
Error message
ExpectedConditions’ is obsolete: ‘The ExpectedConditions implementation in the .NET bindings is deprecated and will be removed in a future release. This portion of the code has been migrated to the DotNetSeleniumExtras repository on GitHub (https://github.com/DotNetSeleniumTools/DotNetSeleniumExtras)’
The problem
Winter is coming! And so is Selenium 4.0 🙂 That’s exciting news because it means that it’s getting better. However, this also means that there are some things that will be deprecated. ExpectedConditions.cs will be moving to a different Nuget package. Right now, if you are using Selenium 3.X, this is just a warning. Later, you will not be able to do this.
The Solution
I outlined the solution in depth here
Visual Studio Errors
If you are using Visual Studio with C# for your Selenium automation, you can find common Visual Studio error here.
I got this exception while executing a simple program to test selenium:
Unhandled Exception: System.TypeLoadException: Could not load type ‘OpenQA.Selenium.Chrome.ChromeDriver’ from assembly ‘WebDriver
What is the problem?
Are you using Java bindings? If so, I am not familiar with Java binding errors.
OpenQA.Selenium.WebDriverException : A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL http://hub-cloud.browserstack.com/wd/hub/session/6a9462564325d212d46b32980d2f14252f1e8313/keys. The status of the exception was KeepAliveFailure, and the message was: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.
—-> System.Net.WebException : The
Problem occurs when tests run using TFS release nightly build
I am trying to create POM Framework. Code was working till yesterday and from today same code is giving “ArgumentException was unhandled by user code”
An exception of type ‘System.ArgumentException’ occurred in WebDriver.Support.dll but was not handled in user code
Additional information: The SearchContext of the locator object cannot be null
I have sanity script – which is calling test script and that script is refering to page object class. Error is coming in the pageobject class @ PageFactory.InitElemtns(driver, this); line below:
public LandingPage(IWebDriver driver)
{
this.driver = driver;
PageFactory.InitElements(driver, this);
}
DOn’t use PageFactory it has tons of issues. That’s probably why you are getting that error. Use properties to just return your elements.
If you want to know how to structure you page objects well, take a look at this Page Objects Course
wise advice
Hi Nikolay, I am loving the course!
I have encountered some strange issues in Visual Studio. I am using Windows 10 Home, Visual Studio Professional 2017, ChromeDriver 2.33, supports Chrome version 62+, using Chrome Version 62.0.3202.75 and Selenium.Support and Selenium.Webdriver version 3.7.
1. In “How to download and install Selenium Webdriver” I have noticed as you type “var driver = new ChromeDriver();” the “using OpenQA.Selenium.Chrome;” gets added automatically, not in my case. I had to type in myself.
2. Intellisense is not working.
3. Chromedriver > Properties (“How to download Chrome Driver) is missing “Advance” category hence “Copy to output directory” is unavailable.
What am I missing?
Thanks in advance.
Excellent 🙂
Hi Nikolay, can you please answer 3rd. question, i.e. In Visual Studio > Solution Explorer, Chromedriver > Properties (“How to download Chrome Driver” video) is missing “Advance” category hence “Copy to output directory” is unavailable.
What can I do to fix this?
Thanks.
Just wanted to mention that I found the solution to Visual Studio 2017 Intellisense fix. Apparently there is a bug!
Hello,
I am having trouble identifying an element. My application has a left navigation menu called New and when expanded it shows sub menus.
I was able to identify New and then clicked on it. But failing to identify the sub menu.
This is a part of the code that I have so far …
IWebElement navmenu = driver.FindElement(By.XPath(“//*[@id=’subMenuModules’][8]”));
navmenu.Click(); //success
Thread.Sleep(TimeSpan.FromSeconds(15));
IWebElement contactclick = driver.FindElement(By.XPath(“//*[@id=’collapse’]/paper-menu/div/paper-item[1]”));
contactclick.Click(); //failing .
https://uploads.disquscdn.com/images/dd5530de7ce43e4a7301f4f35bdaff017ab30c90da6ff9a4c9c779bff83c96e1.png
Please see attached screenshot for the HTML.
Thank you and appreciate your support.
-Sharmila
Do you need to hover over an element to click it? Usually that is the case. Especially this looks like a submenu. So you probably need to hover on an element. Or click some element first. THen open the menu, then proceed?
Hi, I have problems with IE 11 – (IE11 in test requirements)
What I did:
I have downloaded IE driver from http://selenium-release.storage.googleapis.com/index.html?path=3.9/
name of the file IEDriverServer_Win32_3.9.0.zip -> unzipped -> Placed to WebBrowserFactory =
I can run IE11 browser and open target website
What is wrong:
If I run 6 tests together
I can’t open any locator – So FIRST test is ok – but for rest five tests I have error bellow:
————–
“OpenQA.Selenium.NoSuchElementException: Unable to find element with css selector == #loginUsername”
————-
but same code works perfect in Google Chrome
Latest version try WebDriver/IEDriver v3.9, v3.9.1, v3.8 – different version combinations
What do you mean run tests “together”. Do you mean in parallel, all at the same time? Or do you mean as a suite of 6 tests, one at a time?
If it’s the former. The problem isn’t I É. The problem is that your tests are probably not independent, making parallel execution impossible.
My bad. Not good explanation. So I have 6 tests now. not in parallel – And I click Run All at Test explorer
Okay, so then it might be a problem with IE then. Remember that different browsers render HTML differently. In fact, I feel like IE doesn’t support CSS locators if I remember correctly?
May I as why you are using IE? Almost nobody in the world uses that browser. In fact, Microsoft no longer suports it – https://venturebeat.com/2016/01/12/microsoft-ends-support-for-ie8-ie9-ie10-and-windows-8/
That’s why they created Edge.
So although I might be able to help you fix the running tests on IE. I think that we’re placing a band aid on a larger problem that will come back and kill your automation. The problem being that you use IE. At worst, use Edge. At least it’s build with Selenium integration.
Sorry if that’s not the answer you’re looking for, I need to be honest and help people to come up with the best solution possible.
May be…. I use these
private IWebElement UserField => Driver.FindElement(By.Id(“loginUsername”));
private IWebElement PasswordField => Driver.FindElement(By.Id(“loginPassword”));
private IWebElement LoginButton => Driver.FindElement(By.Id(“loginSignInButton”));
That’s not what your error shows:
“OpenQA.Selenium.NoSuchElementException: Unable to find element with css selector == #loginUsername”
Also, the question is, do these tests work in Chrome fine? But then don’t work in IE? If the answer is yes, it’s your locators. You need a different strategy for IE.
I am going through the examples in the LightPomFrameworkTutorial package. I am getting a build error on many of the examples. The error is “AutomationResources.dll could not be found”
As a specific example, I am working with SampleApp2. When I build the solution I am getting the following error:
Severity Code Description Project File Line Suppression State
Error CS0006 Metadata file ‘D:VS ProjectsLightPomFrameworkTutorialAutomationResourcesbinDebugAutomationResources.dll’ could not be found SampleApp2 D:VS ProjectsLightPomFrameworkTutorialSampleApp2CSC 1 Active
I looked in the ‘AutomationResourcesbinDebug’ folder and as the error states, there is no AutomationResources.dll there.
This same error is coming up during building of many of the examples.
How can I correct this error?
Thanks,
Jim
do you have chromedriver.exe being ran in the background? If so, kill it and try again
Wow, that worked. You’re amazing!!!
A number of the examples in “ElementIdentification.cs” (that show the various ways to use an Element Locater) are failing.
The following is one example of the errors I am getting:
ProjectsLightPomFrameworkTutorialElementInteractionsElementIdentification.cs:line 44
Result Message:
Test method ElementInteractions.ElementIdentification.ElementIdentificationTest threw exception:
OpenQA.Selenium.NoSuchElementException: no such element: Unable to locate element: {“method”:”name”,”selector”:”NameExample”}
(Session info: chrome=65.0.3325.181)
Can you use this url to test against instead? https://web.archive.org/web/20170808214449/http://www.qtptutorial.net:80/automation-practice/
My new page is not fully finished
Sent from TypeApp
That doesn’t work (I already tried it). That link is the link I sent you from the web archives (WaybackMachine).
The problem is, even though the web pages are archived, the contents remain the same.
For example, if you look at the underlying code for the “Click This Button Using ‘Name’ Property”, you will see …
which is still pointing to qtptutorial.net.
Hey Jim,
I’ll need to finish adding all of the elements here https://www.ultimateqa.com/simple-html-elements-for-automation/ . Please give me a day or 2 to finish that.
No problem. I’ll move on to ‘Implicit and explicit waits’ in the mean time. Thanks for all your efforts!
Hi Nikolay, great course, really enjoying it so far!
I’m just having a few issues with nlog and getting data written to a file in the following location: c:temp${appName}Debug.log”
I’ve tried copying the code from the config file on your github repository but have had no joy. However, when I debug the tests and hit the line of code relating to the logging of data I get an error as below. The test then runs successfully but I don’t see a log file being generated(screenshot 1)
https://uploads.disquscdn.com/images/b3f65c9ef623284e06d5b8c6197c6092e9b62248a892203ea421d1f1ab479e6b.png
For reference the HomePage code is below too(screenshot2)
I can recommend that you try 2 things:
1. Compare your Nlog.config to mine. And also your source code to mine. What’s the difference?
2. Try to start Visual Studio as administrator and let me know if that helps.
Sorry Nikolay, here is the second screenshot
https://uploads.disquscdn.com/images/85ffeba4da5f9167c223b20032a372f8139eccd3006ddafe0c1d557698e66ffe.png
Hi Nikolay,
I found an issue in one of the videos I thought you’d want to be aware of.
Answer to why the test is flaky:
The audio cuts out around 0:41
Besides that, this is the most amazing Selenium (and C#) training I have ever seen!
Thank you for putting this course together.
Jim
Hey Jim, thank you so much. I’ll have that fixed this weekend! Appreciate you taking time out of your day to report this issue 🙂
Thanks for the compliment as well. I’m actually updating a bunch of stuff, so it’s about to be even better 🙂
Hey Jim, that video is fixed!
Awesome, thank you!
Hi Nikolay,
Just fyi, the section:
Different types of Visual Studio projects > Class library project
doesn’t have audio until 3:34
Thanks sir, it’s fixed
In the code for the lesson on Element Identification, the following code needs to be changed for this test to pass:
From inside ElementIdentification.cs …
From:
[TestMethod]
[TestCategory(“Element Interrogation”)]
public void ElementInterrogation()
{
driver.Navigate().GoToUrl(“http://www.ultimateqa.com/automation/”);
var myElement = driver.FindElement(By.XPath(“//*[@href=’http://courses.ultimateqa.com/users/sign_in’]”));
}
To:
[TestMethod]
[TestCategory(“Element Interrogation”)]
public void ElementInterrogation()
{
driver.Navigate().GoToUrl(“http://www.ultimateqa.com/automation/”);
var myElement = driver.FindElement(By.XPath(“//*[@href=’https://courses.ultimateqa.com/users/sign_in’]”));
}
So, the change is from @href=’http: to @href=’https:
I hope this helps,
Jim
Thanks Jim 🙂
All fixed. Yea, we updated to HTTPS and didn’t update the code.
In C#, does anyone know how to check to see if a connection (driver) is already connected?
I am writing automation for a device and want to check for the existence of some elements on the html page but I only want to do it if there is already a web driver connected to the web page.
I want to do something like this:
if Driver is connected
run this test
else
send a message to user that a web driver must already be active (connected).
Thanks,
Jim
Hey Jim, what are you trying to accomplish?
I am writing automated tests for a device and I have a test which verifies that certain header and footer elements are on every page. I would like to run this test without having to call the login section (which connects to the page and logs in a user).
Hence, I am trying to find a way to check and see if there is a ‘driver’ instance running (which connects this page … the html page is showing in the browser).
If the html page is running in a browser, I want to run this test to verify that the elements are present but if the html page is not running in the browser (hence it is not connected and a webdriver is not running) I want to NOT run the script.
Does this make sense? In summary, I am trying to find a way to check if the html web page I am testing is running, if so, run this test, if not don’t run the test.
Maybe this can’t be done, I don’t know. I haven’t been able to find a way.
Thanks,
Jim
If you have requirements that must be checked in a single test, then use that test to check the requirements. You shouldn’t be using 2 tests to validate the requirements of one test. One test, one driver. All tests must be atomic and isolated. Hope this helps.
Thanks Nikolay, I appreciate it.
Hey Nikolay,
I am taking part in your udemy course ‘Selenium WebDriver-Working With Elements’. I am currently watching video no 58 and I have a problem with opening Network Tab in Firefox. Firefox is opening and google page is opening, but then nothing happens. I have Firefox 61. Here’s my code:
var _driver = new FirefoxDriver();
var _actions = new Actions(_driver);
_driver.Navigate().GoToUrl(“https://www.google.com/”);
_actions.KeyDown(Keys.Control).KeyDown(Keys.Shift).SendKeys(“e”).Perform();
_actions.KeyUp(Keys.Control).KeyUp(Keys.Shift).Perform();
Ania
Ania
Hey Nikolay,
I am taking part in your udemy course ‘Selenium WebDriver-Working With Elements’. I am currently watching video no 58 and I have a problem with opening Network Tab in Firefox. Firefox is opening and google page is opening, but then nothing happens. I have Firefox 61. Here’s my code:
var _driver = new FirefoxDriver();
var _actions = new Actions(_driver);
_driver.Navigate().GoToUrl(“https://www.google.com/”);
_actions.KeyDown(Keys.Control).KeyDown(Keys.Shift).SendKeys(“e”).Perform();
_actions.KeyUp(Keys.Control).KeyUp(Keys.Shift).Perform();
Thanks,
Ania
I was wondering if anyone would help me out here. I’ve learned a LOT from this class but one thing I seem to be missing (I can’t find the answer anywhere) is how can I replace the “Assert” commands with something like a “Verify” or a Soft Assert within C#.
When I have an assert that unexpectedly fails, I get an exception which stops the tests. What I am trying to figure out is what can I use in C# and Selenium such that when I get a failure of any kind, the failure is reported and the tests continue to the end.
I am automating some functional tests (rather than unit testing) and, although maybe unconventional, I have tests that test multiple items on an html page (I have no choice, I was instructed to do it this way). I want my entire test sequence (which tests multiple buttons, check boxes, pull down menus) that all have asserts to be completed. If one assert fails, I need that failure to be reported somewhere (I haven’t figured out how to get my test results to output to an HTML file) and then continue the test until the end.
So, how can I run a test sequence with multiple asserts (again, I have no choice) and if one of the asserts fails, the entire test sequence continues until the test sequence has completed.
I need an output report that lists all the passes and failures and NOT have the test stop until it has completed.
Thanks,
Jim
There is no such concept because it’s not a valid concept in test automation. There’s a saying, fail fast and fail early so that you get real value from your test. If you don’t want to Assert and fail, then just don’t assert. If you just want to report, then just use the Reporter class. Assertions are for stopping the test. Reporter is for reporting steps. Check out the Reporting section of the course, it will teach you how to just log informational steps which have no impact on the test outcome.
hello, i am just starting the selenium course and am having issues following along in section 2. i downloaded the code and wanted to run the test that dr. tiffiny showed in the ‘unit test’ section. however, i am getting error with ‘NuGet package.’ i’ve tried going to recommended page to restore NuGet, but my settings in VS are checked, as they say they should be. i am totally new to automation and coding and vs, so i am at a loss. can anyone help? here is a screenshot of the error message. thank you in advance!
https://uploads.disquscdn.com/images/de909bdd74168f418a365097deb6c85e829602c19e72019e10a3d5edb5f9d53e.png