How to solve Selenium error Element is not clickable at point (x, y) Other element would receive the click

The error message looks like this:

System.InvalidOperationException : unknown error: Element <... (html) ...> is not clickable at point (x, y). Other element would receive the click: <...(html)...>

Stack trace
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebElement.Click()

Solution:
The clickable element is not ready, it might not be visible or clickable.
Sometimes the element is covered by another html element. (hide the covering element first).

Steps:
1. Wait for element to be visible
2. Wait for element to be clickable
3. Click with javascript

If this still this doesn’t work insert an implicit wait between step 1 and 2. (Thread.Sleep() in c#)

C# driver code to solve problems:
Wait for element to be visible and clickable (ElementToBeClickable = element is visible AND enabled.)

        public IWebElement WaitUntilElementIsClickable(By findElementsBy)
        {
            var wait = new WebDriverWait(driver, timeoutForElementShouldBeVisibleInSeconds);

            try
            {
                var element = wait.Until(ExpectedConditions.ElementToBeClickable(findElementsBy));
                return element;
            }
            catch (Exception exception)
            {
                string message = exception.Message + " at findElementsBy " + findElementsBy.ToString();
                Exception customException = new Exception(message, exception);
                throw customException;
            }
        }        public IWebElement WaitUntilElementIsClickable(By findElementsBy)
        {
            var wait = new WebDriverWait(driver, timeoutForElementShouldBeVisibleInSeconds);

            try
            {
                var element = wait.Until(ExpectedConditions.ElementToBeClickable(findElementsBy));
                return element;
            }
            catch (Exception exception)
            {
                string message = exception.Message + " at findElementsBy " + findElementsBy.ToString();
                Exception customException = new Exception(message, exception);
                throw customException;
            }
        }

Click with javascript:

        public void ClickOnElement(string cssElementSelector)
        {
            string js = $"document.querySelector(\"{cssElementSelector}\").click()";
            ExecuteJavascript(js);
        }
		
		        public string ExecuteJavascript(string script)
        {
            return ExecuteJavascript<string>(script);
        }

        /// <summary>
        /// Executes JavaScript in the context of the currently selected frame or window.
        /// </summary>
        /// <typeparam name="T">The converted return type</typeparam>
        /// <param name="script">The JavaScript code to execute.</param>
        /// <param name="args">The arguments to the script.</param>
        /// <returns></returns>
        public T ExecuteJavascript<T>(string script, object[] args = null)
        {
            IJavaScriptExecutor javaScriptExecutor = uiTests.Driver as IJavaScriptExecutor;
            object result = null;

            var wait = new WebDriverWait(uiTests.Driver, timeout: TimeSpan.FromMinutes(3));
            wait.Until(ExpectedConditions.ElementIsVisible(By.TagName("body")));

            result = javaScriptExecutor.ExecuteScript(script, args);
            T typedResult = (T) result;
            return typedResult;
        }

 

Read and understand code faster with programming ligatures in Fira Code font | Making Visual Studio perfect

I was recently on a conference and spotted this nice code font:
Fira Code
which makes use of “ligatures” that takes common programming characters and make them more readable.

Such as >= ++ != and presents them in a more condensed and more readable way.

Read more here:
Read and understand code faster with programming ligatures in Fira Code font | Making Visual Studio perfect

To use in Visual Studio 2017, download from:
https://github.com/tonsky/FiraCode/releases/download/1.204/FiraCode_1.204.zip

Unzip ttf folder select all fonts, right click menu and install.
Open/Restart VS2017 -> Options -> Environment -> Fonts and colors -> Select “Fira Code” as font.

Fira Code on github:
https://github.com/tonsky/FiraCode

Scott Hanselman on Monospaced Programming Fonts with Ligatures:
https://www.hanselman.com/blog/MonospacedProgrammingFontsWithLigatures.aspx

Interesting read about agile and lean development

Interesting blogpost called:
Making sense of MVP (Minimum Viable Product) – and why I prefer Earliest Testable/Usable/Lovable

There are examples of development of the early Spotify  app as well:

Source: Crisp’s Blog » Making sense of MVP (Minimum Viable Product) – and why I prefer Earliest Testable/Usable/Lovable

How to recover lost Chrome bookmarks after sync

In the %userprofile%+AppData\Local\Google\Chrome\User Data\Default
folder in Windows, there is a file called Bookmarks -> replace it with the Bookmarks.bak or use windows file history function.

(Backup bookmarks.bak before as well)

More info here:
How can I restore bookmarks after sync – Google Product Forums

https://superuser.com/questions/480670/undo-google-sync-in-chrome

Productivity Tips for Visual Studio 2017

I’ve written a few blog posts thus far regarding Visual Studio 2017, so I thought I would take some time to discuss the features that were introduced in this latest version that might help your productivity, or that you just may find useful.

You’ll notice that the title of this post mentions that they are “secret”. This is because all of these features are disabled by default, so you’ll need to enable them, either locally (per project) or globally, to take advantage.

Source: “Secret” Productivity Tips for Visual Studio 2017 – CodeProject

How do I get NuGet to re-install/update all the packages in the packages.config?

Reinstall all packages in project:
Update-Package -reinstall -Project YourProjectName
Reinstall package “Antlr” in project:
Update-Package -reinstall Antlr -Project YourProjectName

See more here:

The following command will update all packages in every project to the latest version available from nuget.org.
Update-Package
You can also restrict this down to one project.
Update-Package -Project YourProjectName
If you want to reinstall the packages to the same versions as were previously installed then you can use the -reinstall argument with Update-Package command.
Update-Package -reinstall
You can also restrict this down to one project.
Update-Package -reinstall -Project YourProjectName
The -reinstall option will first uninstall and then install the package back again into a project.
Or, you can update the packages using the Manage Packages dialog.

Source: How do I get NuGet to install/update all the packages in the packages.config? – Stack Overflow

 

SourceTree very slow when switching repository tabs

My SourceTree GIT manager was freezing for 5-10 seconds when switching between repositories.

These commands fixed the issue:

$ git config --global core.preloadindex true
$ git config --global core.fscache true
$ git config --global gc.auto 256

Also in combination with adding GIT program folder and SourceTree program folder to excluded paths for Windows Defender (antivirus scanner). The switch between tabs is now instant.

Source: SourceTree very slow with many repositories