Blogs

Get useful information on apps testing and development

Test Scenarios to Avoid on Selenium

Priyanka Charak | Posted on | 2 min Read

Testing Scenarios You Should Avoid While Automating With Selenium

Introduction


Selenium is a widely used web automation testing platform, and Selenium Automation is in great demand today. There are plenty of real-time test scenarios in selenium testing where the need for Automation is justifiable. But, according to some testing experts, it is not always recommended to test all the test scenarios using Selenium. As a web automation tool, Selenium primarily aims to test if different web applications are compatible across multiple browsers. Though automated testing is the need of the hour, automating everything is not reasonable.

Let us understand why automation with Selenium WebDriver is not possible in all the cases and analyze which test scenarios it does not support independently. We will also discuss various Selenium WebDriver real time scenarios that should not be considered for automation.


  • CAPTCHA

You must have seen CAPTCHA verification on most websites to assess if the user is a bot or a real human being. Understandably, CAPTCHA is about preventing automation. Otherwise, it will fail to perform what it is intended. Please note that Selenium Test Automation cannot be used for CAPTCHA verification. However, following one of the best practices mentioned below can disable it.

 
You can consider the following practices for automated test scenarios in the case of CAPTCHA:

 -CAPTCHA should be disabled in the test environment by simple configuration in the software
  during testing or by setting a URL parameter.

 – Adding a hook can allow a test to divert the CAPTCHA

 – Making the CAPTCHA an option in the test environment to run the test smoothly even if the
  CAPTCHA is skipped.


  • VISUAL TESTING

Visual automated Testing or screenshot testing focuses on checking if the Graphical User Interface is looking as intended for the end-user. Selenium can capture screenshots of the full page and web elements on the page. It is important to check how the page looks on different devices and screen resolutions. Instead of WebDriver, it is better to invest in a visual testing tool. Taking screenshots is one thing, but performing a visual comparison of images is a different process altogether and cannot be handled by Selenium Web Driver.


  •  TWO-FACTOR AUTHENTICATION (2FA)

Another scenario that you should not automate is in the case of two-factor authentication, where mobile apps generate OTP and push messages, etc., by using an authenticator and sending OTP by SMS or Email. Although you can automate this scenario in Selenium, it is a significant challenge to integrate it with the Selenium WebDriver. This is simply because it will add another layer, which is not secure. Organizations don’t automate OTP submission but choose to do the following instead:

– Disable 2FA on the test environment while tests are running

 – Disable 2FA for specific user credentials that are used for running 

   automated tests

 – Disable 2FA while logging in from specific IPs. This way, you can write tests based on a test machine chosen. It does not apply to cases where any random test machine is chosen from a pool of machines.


  • QR CODE VERIFICATION


Considering Selenium for Barcode/QR code verification is not recommended by experts. Barcodes can be verified and automated by integrating external APIs to the Selenium WebDriver real time scenarios. Manual testing is preferred more than automated one as it yields better accuracy.

QR code verification testing on remote devices

https://youtu.be/VIGvLpue-xc

  • FILE UPLOAD & VERIFICATION

Selenium WebDriver can be used to execute testing scenarios in a web app. For example, Selenium Webdriver can only automate the simulation of the user action of clicking on the upload button; it cannot verify if the file was successfully uploaded and shows on the screen. Tools like AutoIT are used for file uploading for Windows after which an additional verification tool has to be used to verify if the upload was successful. Businesses do this only if it is urgent to automate each step of the user flow.


  • FILE DOWNLOADS & VERIFICATION


Although file download scenario testing can be performed using Selenium it cannot verify the ongoing content downloading progress in the Downloads.  The only way to verify is to compare the number of files in downloaded items. Also, verifying if the downloaded content matches the expectations requires some manual intervention. This feature has to be explored more to carry out Selenium Test Automation.


  • PERFORMANCE TESTING

Performance testing is another test scenario that you should not automate with Selenium WebDriver. You can create Selenium WebDriver real time scenarios for performance test execution, but Selenium is not ready for performance testing. Hence, it doesn’t yield favorable results. WebDriver tests are subjected to extrinsic and intrinsic fragility points like browser start-up speed, HTTP server speed, response of JavaScript and CSS third-party servers, instrumentation penalty of WebDriver implementation, etc., are not in our control. You can go for front-end performance testing tools like Google Lighthouse to perform faster performance tests, JMeter for performing load testing.

  • APPLICATION CRAWLING

Link spidering or application crawling saves time and cost by finding out which links are broken. Selenium WebDriver is not a recommended tool to crawl through links because it takes more than a minute to crawl based on how the tests are written. Finding broken links with Selenium WebDriver might work when there are few links on the page or the rare website. Hence, link spidering tools must suit your requirement. There are simpler tools than Selenium that can be considered for checking broken links. some of them are – brokenlinkcheck.com and deadlinkchecker.com.



  • SOCIAL MEDIA LOGINS AND EMAIL INTEGRATIONS

Performing Automated Selenium scenarios testing through UI for Social Media and Email Logins is not advised, because integrating these apps might fetch unreliable test performance. So, it is better to add APIs in such cases for faster test execution and reliability.


  • AUDIO OR VIDEO STREAMING

People nowadays consume a lot of visual content online on YouTube and other OTT platforms. So automating testing for AV content also becomes critical. Selenium WebDriver is not a suitable tool for Test Automation of scenarios like these because Selenium does not always recognize the video controls. StreamTest, a free tool, can measure how the URLs perform and check the end-user experience quality, but its output is not hundred percent reliable. Even JavaScript Executor and FlexUISelenium are unable to provide assured results. According to the experts, Artificial Intelligence might help to measure the video quality. Also, it is impossible to validate such real time scenarios in selenium testing.


  • Online Screen Sharing Platforms

The rise of the COVID-19 pandemic has increased our dependency on online video conferencing platforms like Zoom, GoogleMeet, etc., for remote work. Because of its increasing demand, it becomes crucial to test and automate user test scenarios. Using tools like Selenium for this purpose wouldn’t help in achieving the expected test efficiency. Applications like these need tools more advanced than Selenium. So, in such cases, critical information and feedback to improve the product are gathered from the end-users by simple means like surveys, etc.


  • API TESTING

 You cannot consider API Testing for Selenium WebDriver real time scenarios due to its efficiency. There are tools like Postman, RestAssured, etc., that are good at performing API Testing. Experts advise performing API Testing separately in a different suite altogether to achieve better efficiency.


  • Security Testing

Protecting web applications and securing other online offerings from Security threats is a critical need of any enterprise. Different tools like JSky, Owasp Zap, Burp suite, etc., are used for complete web security by the Cyber security team to protect the web applications and other online services from any possible security threats. Selenium is not equipped for performing Security testing. So, it is not recommended to test such real time scenarios in selenium testing.


Selenium scenarios

  • Windows Apps Testing 

Selenium WebDriver cannot automate windows applications. Hence, Microsoft created WinAppDriver (Windows Application Driver) to support Selenium-like UI test automation for windows-based applications. It requires C# coding environment like Visual Studio to execute automation test scenarios running on Windows apps. Even Sikuli and AutoIT are used to test Windows components integrated into a pre-existing Selenium test framework.


  • Mac Apps Testing 

Mac App Testing cannot be considered for Selenium WebDriver real time scenarios, for the same reason as Windows apps. For Mac Apps, Appium’s Mac driver is integrated with the existing Selenium Test Framework for performing basic automation.


  • Mobile App Testing

Selenium is not even recommended for native mobile application testing. Appium Mac Driver is a layer on Espresso, UI Automator, and XCUITest frameworks. Hence, these tools should ideally be considered to achieve maximum efficiency and cover most of the selenium real time scenarios testing.


Conclusion



We should not forget that automation aims to save efforts, time, and money and that Selenium is an ideal tool for cross-browser compatibility testing. These are the topmost real time scenarios that you should not automate with Selenium WebDriver. Other than these, Selenium real time scenarios like Image Verification, Layout Testing, Exploratory Testing, Usability Testing, Libraries & Framework Testing, etc., performing Selenium test automation would not add any value. In some cases, it might work, but it is imperative to understand that you cannot use Selenium to automate test scenarios everywhere and anywhere! Hopefully, the points mentioned above shed some light on facts explaining why you should not automate everything using Selenium.


Selenium Grid

Priyanka Charak

Tech Blogger - She writes about Technology, Mobile Application Development, Internet of Things, E-commerce, Computing and Design with the aim to coalesce new media and technology.