Untargetable buttons for automated testing / mx-underlay

1
Hi , I am using selenium webdriver with C# language binding in Visual Studio 2017. When i try to locate the  button, it fails to locate the element when i use any of the locators ex: CssSelector, Classname or XPath. It throws the following error message:  Message: System.InvalidOperationException : Element <button class="btn dropdown-toggle dropdown-button btn-default" type="button"> is not clickable at point (1837,30) because another element <div id="mxui_widget_Underlay_1" class="mx-underlay"> obscures it I tried also the selenium IDE, it records and gives the same XPath as target and its successfully executed. If I apply the exact same XPath to the target in selenium webdriver, its throwing the above error again.  I checked with the developers and found out that the mx-underlay class is not created, nor used by them. How do I go around this problem to be able to target and click buttons through the automated testing? Thanks in advance.
asked
2 answers
6

Hi Millon,

 

First of all you should know that the mx-underlay class is used in blocking pop-ups.

This is default Mendix, thus is not implemented by the developers.

What might be the case here, is that the Selenium script tries to click somewhere, but the application is still "calculating", thus showing the blocking pop-up.

In that case, try the following code (this will keep the script waiting for 4000 milliseconds):

Thread.sleep(4000);

Another thing you could try is waiting for a specific element to be loaded on the screen (after the action is completed).

More for this, you can find here: https://stackoverflow.com/questions/20009211/getting-selenium-to-pause-for-x-seconds

 

If all above do not work out for you, I found this thread: https://github.com/mozilla/geckodriver/issues/243

Please try to include "AddAdditionalCapability("specificationLevel", 1);" as shown in this example:

var options = new FirefoxOptions();
options.AddAdditionalCapability("specificationLevel", 1);
options.BrowserExecutableLocation = @"C:\Program Files\Nightly\firefox.exe";
using (var driver = new FirefoxDriver(options))

Hope this helps.

 

Regards,

Mikael

answered
0

Hi Mikael,

Thank you for the reply that really helped.

answered