Advance Selenium

Most Common Challenges You Faced in Selenium Automation

Most Common Challenges You Faced in Selenium Automation

Selenium is an open-source test automation framework and it has its own advantage and disadvantage as well. Even if you take other automation tools like QTP, Katalon, Sahi, etc every single tool has some kind of limitation. Today I am going to discuss some challenges which we face in our day to day activity. The most common challenges you faced in Selenium Automation might defer.

Most Common Challenges You Faced in Selenium Automation

You can also add a few more challenges based on your previous/current experience but below listed one common for each and everyone in Test Automation.

Challenges Faced In Selenium Webdriver In Automation

 

Sync issue or Timeout

Sync issue or I would say timeout issue is one of the most challenging tasks in any test automation tool. If we do not handle sync issue then most of the script will fail. In one of the test surveys, it has found that 80% of scripts fail due to improper sync while performing actions.

We can avoid this by using smart wait which is present in Selenium like implicit wait, explicit wait, fluent wait or even you can write your custom method which will handle these sync issues.

Example– After clicking on some button one alert should present and we have to handle via code but due to many issues alert might come after a few seconds, in that case, the script will fail. We need to handle this kind of scenario using an explicit wait. This is just one example like this we have many examples which show without a smart locator we cannot build stable scripts.

 

Integration with different tools

Since Selenium is open-source and we all are using many open source tools like Maven, Jenkins, AutoIT, etc. so integration between these tools is sometimes a very challenging task.

 

Smart locators

As we all know that locators are the core part of any scripting and we need to keep on enhancing our XPath and CSS for script stability, because if XPath and CSS are not proper then chances are very hight that script might fail in upcoming releases.

We should always write dynamic or custom XPath or class, which can make our script more stable.

Cross browser testing

While designing script we always focus on one browser and we design our script for that browser only, but when it comes to real execution of the script then we have to make sure that our script should run in all browser which is known as Cross Browser Testing (Chrome, FF, IE at least). I had been struggling with this topic , because few locators will work in one browser but not on the other. In order to avoid failure once the script is developed we need to run them on the different browsers and analyse the result. If it is failing on another browser then we need to change locator strategy.

Nowadays we have many cloud companies like SauceLab, BrowserStack etc which provide as complete infrastructure like Windows, MAC, Linux with different browser combinations as well, so if our script is compatible with all then it will be easy for us to run on the cloud.

 

Framework Enhancement & Maintenance

We always work for the framework but framework designing and maintenance is not a one-day activity, we have to keep on adding new features or libraries so that we can minimize execution time and maintenance task.

 

Pop up handling

In many applications, you will find random pop that keeps coming and their behaviour is not persistent, so we also have to take care of these unwanted pop up which stops our execution.

Complex Programming

Selenium support multiple languages and in order to work we should know at least one programming language so in order to build a framework we need some expertise in a specific language.

Lack of Transparency

Few companies or I would say many companies they do not follow proper code review which can create many issues in the future.

Example- Code review includes code formatting, proper validation or assertion, effective usage of the framework, the design pattern used and so on.

That’s all I have from my side, whatever challenges you have faced in your organization or in your current role feel free to comment below. I would love to hear from you.

 

I hope this article helped you. If yes then kindly share with your friends and follow me on my Youtube channel as well.

author-avatar

About Mukesh Otwani

I am Mukesh Otwani working professional in a beautiful city Bangalore India. I completed by BE from RGPV university Bhopal. I have passion towards automation testing since couple of years I started with Selenium then I got chance to work with other tools like Maven, Ant, Git, GitHub, Jenkins, Sikuli, Selenium Builder etc.

13 thoughts on “Most Common Challenges You Faced in Selenium Automation

  1. Bibhas says:

    Hi Mukesh,
    Need your help as always. I have one BasicHttpBidingServices that I need to automate.Manually I test each request with authentication in SoapUI5.3.0.Each binding has almost 10 requests.So I want to automate like- for 10 request scripts in the binding tree should be triggered at a time or one by one where we need to change the request parameter externally.

    Please provide some solution on this.This is for WebServices only not for REST.

    1. Hi Bibhas this will be data driven test for SOAPUI, please check below link which will give idea https://www.soapui.org/docs/data-driven-tests/using-files.html

      1. Bibhas says:

        Hi Mukesh,
        I don’t have license version of SOAP that is why want to automate using Selenium. Is there any way to automate.

        1. Hi Bibhas,

          Selenium only automate WebBrowser so we need to take help of third party library or custom Java code.
          In Java we have HTTPURLConnection class which can automate Rest and SOAP both. You can get reference from below link https://www.journaldev.com/7148/java-httpurlconnection-example-java-http-request-get-post

  2. Reshma Patil says:

    Hi Mukesh,

    I am currently automating SAP web based system.
    When i m trying to click on a particular element its opening a new window everytime.
    I tried switching window with the current syntax and when i try entering values on new opened window its giving me errors like unable to locate the element.
    I found the xpath on chrome browser its highlighting the element correctly in chrome but when I add in my code its not working. Tried maximum possible xpaths but its not working for me.
    Could you please help

    1. Hi Reshma,

      Looks like you are able to switch to new window. Then you need to check whether target webelement is lying on some frame or not.

    2. Reshma Patil says:

      I tried inserting sikuli and its working fine but for selenium its still not working.

      1. Hi Reshma,

        Good…
        Selenium has its own limitations that is why we require to use third party tools to achieve our task.

  3. sean paul says:

    alert(“Getting life!”)

    1. driver.switchTo().alert().accept();

  4. Tanu says:

    yes code review is one of the serious problem ……

  5. karthik babu says:

    Brief and precise note on all the challenges. Nice write up

    1. Hi Karthik,

      Thanks….:)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.