Search This Blog

September 5, 2016

Selenium: Fixed the issue of unknown error: Element is not clickable at point (X, Y). Other element would receive the click

Today, one test failed. After looking into this issue, I noticed that when Selenium Web Driver tried to click the button, it showed the following error.

Message = "unknown error: Element is not clickable at point (1055, 224). Other element would receive the click:

...

\n  (Session info: chrome=52.0.2743.116)\n  (Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),pl...

The source code is easy. Just use Element.Click. It works in Firefox, but fails in Chrome. After using Actions to handle the click button, it is working perfectly.

 Actions action = new Actions(_driver);
 action.MoveToElement(ElementName).Build().Perform();
 action.Click().Build().Perform();       

August 15, 2016

Fixed the issue: HttpWebRequest.GetResponse() throws 500 error

Today one of our automated tests failed. After looking into this issue, I noticed that in this test case, we need to verify the http status code of some links.

The interesting part is that one external link is always working, but HttpWebRequest.GetResponse() always returned the error code 500.

After doing some research, I added the code (Yellow) in our utility class. After running the test again, the test passed.

string url="https://www.XXX.com/";
         
HttpWebRequest myWebRequest = (HttpWebRequest)WebRequest.Create(url);

myWebRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"; 


WebResponse myWebResponse = myWebRequest.GetResponse();

August 11, 2016

How to handle multiple windows in Selenium?

If new members work on automated tests via our Selenium test framework, the common question they have is how to handle the additional window popbox if we click the url in the current window ?

It is pretty easy.  Using the following C # code works perfectly.

                      var windows = _driver.WindowHandles;
                    _driver.SwitchTo().Window(windows[1]);

                      // do something such as Assertion.
                    _driver.Close(); 
                    _driver.SwitchTo().Window(windows[0]);

August 10, 2016

Selenium: How to add C# code to Disable Developer mode extensions in Chrome ?

Today, one automated test failed in Chrome. My Chrome version is Chrome 52.0.2743.116.


 After looking into this issue, I noticed that when running the test in Chrome using C# and Selenium , “Disable Developer mode extensions” popbox appeared all the time. That explained why the test failed.

After adding the following code in the file and running the test, “Disable Developer mode extensions” popbox disappears all the time.

  Namespace: using OpenQA.Selenium.Chrome;
  ChromeOptions options = new ChromeOptions();
  options.AddArgument("--disable-extensions");                    
 _driver = new ChromeDriver(options);

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.

February 15, 2016

How to verify the data accuracy of the EDI 834 file in Parasoft SOAtest?

 In this sprint, we have the new feature where we need to send outbound EDI 834 files to Washington Health Benefit Exchange (WAHBE).

The process is that BizTalk will create the canonical XML files that pass the validation error and then EDI 834 files will be generated automatically.

How to verify the data accuracy in EDI 834 line by line? It is really the challenge in SOAtest. Here is the way.

  • We look for the canonical XML file name in the archive folder.
  • From the Canonical XML file, we can get the EDI file name (Partial)
  • Convert EDI file to XML format

  • In XML Edit, this is the EDI 834 file BizTalk creates and SOAtest converts it to XML format .

  • In XML diff, we parameterize the variables in the elements and then use it to do the data validation with step 4.

  • We don’t need to validate every element in XML tag. We can put XPath in the Ingored Differences. 




From those steps above, it is really easy to validate the data accuracy of EDI 834  in SOAtest.