Search This Blog

March 23, 2016

Selenium and C#: How to do mouse hover action in Selenium?

Today I wanted to verify the texts. The interesting part is that if I don’t do mouse hover action, Selenium WebDriver can’t return the texts. It returns empty string.

If I use the following code (Action-MoveToElement-Perform ) to do mouse hover action on the account menu in the site, I can verify the texts easily.  

Actions actions = new Actions(driver);
actions.MoveToElement(elementName);
actions.Perform();

Thread.Sleep(1000);

March 17, 2016

Fixed the issue in Selenium: An exception of type OpenQA.Selenium.WebDriverException occurred in WebDriver.dll but was not handled in user code

I am currently working on a new project where I need to write Selenium with C# to do the web automation in Visual Studio 2015.

Today after I rebooted my machine, I noticed that Firefox was removed. Therefore, I installed the new version of Firefox (45.0). After that, when running the tests, it caused the following Firefox Driver error, but it was working yesterday. 




I asked my test lead and he noticed that I installed the new version, but we still need to use Firefox 44.02.  After uninstalling Firefox 45.0 and installing Firefox 44.02, running the tests in Selenium passed.

March 10, 2016

Visual Studio 2015: Use the ordered test to run multiple coded web performance tests at a time.

This week, I installed Visual Studio 2015 update 1. After that, I notice that I can’t run selected tests including coded web performance tests in Test List Editor. I can’t run them in Test Explorer either.

However, In Visual Studio 2013, I can use Test List Editor to run selected tests without any issue (Please see The Feature Is Back- Visual Studio 2013 Can Run Selected Tests in Test List Editor).

In this situation, how do I run multiple coded web performance tests at a time in Visual Studio 2015 IDE directly?

  • In coded web performance tests, I need to add IncludeWebTest in the source code. Right Click on this test and choose "Run Coded Web Performance Test". It will run multiple tests at a time. (Note: this is not what I want because it is not user-friendly and coded web performance tests are not supported in Test Explorer.)
  •  Create a new Load Test that contains many coded web performance tests. (Note: This is not what I want because I don’t want to do the load test before coded web performance tests are working.)

  •  Add a new ordered test that contains many coded web performance tests. This time, I can use Test Explorer to run this order test.(Note: Don’t try to put all tests in one ordered test. We can put several tests in one ordered tests.)







I would say Visual Studio 2015 IDE doesn’t provide good design to run multiple coded web performance tests at a time.