Challenges and Solutions in Managing Selenium Test Automation Projects

Listen on the go!

Selenium is a well-known open source testing tool, which provides a robust set of tools that supports rapid development of test automation for web-based applications. It provides a vast set of testing functions designed to fit the needs of testing web applications. Operations in Selenium allow many options for locating UI elements and methods to compare expected test results with actual real-world application behavior. It also supports almost all web browsers to run test cases and also supports many different programming languages to help create or modify test scripts. Languages such as: Java, Ruby, PHP, .Net, C#, Perl, etc.

Challenges faced using selenium automation testing, and how to solve them

Selenium at times fails to function correctly if a dynamic event or change takes place during the test cycle. A few common problems faced are listed below, along with how to mitigate them with selenium test automation.

  1. Dealing with pop-up windows: Selenium can sometimes fail to record common popups in web apps. To handle any kind of alert popup, you can apply a getAlert function. Before actually running the script, you must import a package that can generate a WebDriver script for handling alerts. The efficient interface brings with it the following commands: void dismiss(), void accept (), getText(), void sendKeys(String stringToSend). The first two basically click on the “cancel” and “OK” buttons respectively on a popup window.
  2. No event trigger from value changes: Because Selenium does not initiate events with a change in values, one must do it oneself using fireEvent: selenium.FireEvent(cmbCategory, “onchange”);
  3. Timeout resulting from synchronization problems: One should ideally use selenium.IsElementPresent(locator) to verify that the object is in a loop with Thread.Sleep
  4. Testing Flash apps: To automate flash apps with Selenium, one can use Flex Monkium. The application source code must be compiled with the swc files generated by Flex Monkium. Then the app and the Selenium IDE are connected, and the tests can be recorded with IDE.
  5. Unexpected error launching Internet Explorer. Browser zoom level should be set to 100% by default for the IE browser to overcome this error
  6. Protected Mode must be set to the same valueerror occurs when trying to run Selenium WebDriver on a fresh Windows machine. This issue can be fixed by using capabilities as below when launching IE

DesiredCapabilities caps = DesiredCapabilities.internetExplorer(); caps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true); WebDriver driver = new InternetExplorerDriver(caps);

* On June 1, 2015, SeleniumHQ labeled Cigniti Technologies as an Aluminum Level Sponsor on their official website, www.seleniumhq.org. This recognition confirms Cigniti’s position as a specialized software testing service provider, committed to making sure clients get value from their QA investments. Attending Selenium Conference 2015 at Portland, Oregon on Sep 8-10th 2015? Schedule a meeting with us.

Author

  • 120X120 1

    Cigniti is the world’s leading AI & IP-led Digital Assurance and Digital Engineering services company with offices in India, the USA, Canada, the UK, the UAE, Australia, South Africa, the Czech Republic, and Singapore. We help companies accelerate their digital transformation journey across various stages of digital adoption and help them achieve market leadership.

    View all posts

Comments (2)

  • Vinay

    How to compare text in web page with text of flat file in web driver? Need urgent solution on it…

    February 11, 2016 at 3:28 PM
  • RJCigniti

    HI Vinay, Please reach at contact@cigniti.com they will route your query to concern team and we will ensure that it get answered.
    Thanks.

    February 16, 2016 at 6:39 AM

Leave a Reply

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