Try to avoid this, while writing the selenium Test Scrips.

1,Rely on one browser while testing


It is usually not recommended to test your application in a single browser. Since most browsers are available, you do not know which application our end user accesses.


So comes the need for Cross-browser testing that helps cover high scores, more accuracy in our test results, and simultaneous implementation in multiple locations. LambdaTest is one of the browser cross-cutting testing tools that provides a selenium grid with more than 2000+ browsers running on real applications. A similar test with LambdaTest will ensure that your test cycles are minimized and will ensure that your test documents are completed ahead of time and will allow your code to be treated better.


Since your HTML and Javascript code may behave differently in different browsers, checking your app's source code becomes a priority. It helps us to know and evaluate how the app provides it to various browsers and its version. In today's world where there are hundreds of other website options, the end user will not take much time to switch to a different website and will not return to your app.


With the help of LambdaTest, you can record your tests in multiple browsers in real time which saves you a lot of time and effort. When detected any bug can enter directly from LambdaTest as it provides direct integration with troubleshooting tools like JIRA and much more.

2,Performance Testing Using Selenium


Selenium is not a tool designed to test the performance of your app. To speed up the performance of your app you need to analyze the performance regardless of the environment and browser you are using. Separating individual resources such as CSS or Javascript is required to identify malicious code practices. Selenium is not an appropriate tool for this as it does not provide reporting and analysis related to each operation.


Selenium is closely related to performing functional tests instead of performance as they both have different purposes and objectives. There are various other limitations such as browser startup speed, server speed, Javascript and CSS rendering that play a major role in testing your app performance and selenium alone is not enough to test these frameworks


Apache JMeter is one such tool that can help in checking all the major operating features and also has a WebDriver plugin to support segmenting based on Selenium.


3.Wrong selection for automatic testing


Stop trying to change everything that comes your way while testing the app.


Deciding which tests to take by hand or by default is a decisive decision because nothing will be worse than doing the wrong tests. Never test an unstable UI because it will be a complete waste of human time and efficiency. Stay tuned for a quick strategy to get the tests done more and more considering the preferences of the end users.


Take those tests that ensure the best use and performance of the app. The following investigation cases should be conducted first as part of the process: -
TCs are part of a back-up program.
Unit test cases.
Testing there can work the same way.

4,Insufficient Test Reporting Strategies


What is the use of writing and performing works in which the last and most important information is lost or not disclosed to the parties.


Being an inspector myself, I know the importance of recording and reporting the condition or bugs identified in real life. It has been an hour since without writing down the purpose of this bug, which should have been assigned to quickly find out the problem could be a challenge.


Sharing a build version with a bug screenshot can make it easier for developers to solve a problem. Proper communication between all members of the group so that any identified gap is immediately reported to the person concerned and the necessary steps are taken regarding it as soon as possible.


Selenium relies on third-party tools for better reporting capabilities within the script: -
TestNG - This is a popular unit test framework inspired by JUnit and NUnit. It comes with a library with an automated reporting feature that can be used to generate test reports.
ReportNG - A simple HTML plugin and can be used instead of TestNG reports.
Extensive Reports - These reports provide a lot of clarity based on pie charts, graphs, and other visual effects.
Allure - A lightweight multimedia reporting reporting tool that provides clear graphical reports

5,Test Suite Contains Multiple Testing Cases


As a good practice, try to create scripts that are reused and saved over time.


Creating large test cases can make it difficult to find bugs. Try splitting your large test case into short test cases to save the suite. A major problem with many suspicions would be that if one claim fails the other will not be made.


Maybe a lot of goods mean you test a lot of things with one unit testing unit that should be avoided. If you need to test multiple fields for one task, you should verify them all in each verification because it provides more useful information than checking it all together.

6,Misuse of waiting and sleeping


The importance of Selenium waiting is that it will help you to "wait" until you meet a certain situation without the continuation of the code.


They are required for test scripts as web applications are built using Ajax and Javascript and when a page is loaded by different web browsers it can load at different times. This comes under the DOM tree and when you have a feature that uses the JavaScript function from the library, there is a good chance it may break during testing. The reason why the JavaScript function is not yet loaded.


Therefore, it is difficult to identify items and if they are loaded on time it will throw ElementNotVisibleException. You should choose to use explicit or implicit pending to resolve the above problem. The implication of waiting completely is that WebDriver will select all of your DOM items until the search is completed correctly. Do not combine both expectations as it can lead to unexpected waiting times.


Having a command on selenium waiting is undoubtedly necessary for testers to set an effective automation test strategy, effective waiting implementation can simplify processes, save time, effort and help detect inaccuracies in web pages.

7,Proper Use of Proper Locations



Making the right use of locator while writing a Selenium test script is important as finding the right GUI is a must for building an automated test script.


ClassName and ID selectors can be used to change the code. Link text can be used in a dynamic environment while the XPath test can be used in web browser navigation. Most of these options are based on location, so any inequality in the area can lead to unintended consequences. ID and name are specific selectors while CSS is a combination of both. Xpath needs to be used in the end.


Choosing the right order is important to avoid the problems of automatic testing and build documents that are faster, more reliable, and have less storage than release.

Conclusion :

Common Mistake:

  • To encrypt the code included in the automation script. for example username and password:
  • Too many xpaths are used in automation documents.
  • Data dependence between one text in another script.
  • One-page responsibilities are not retained.
  • Marked codes are stored in Automation script files.
  • No coding standards were maintained.

2 Comments

Post a Comment

Previous Post Next Post