Selenium Best Practices
Selenium Best Practices

Selenium Best Practices

1) Use page objects framework Whenever we mention about the best practices in selenium, Page object model will be the cream rising on top.

Having the page locators and page actions maintained in separate class grooms your code automatically and makes it hassle free.

2) Do not automate End to End NO !!! never think of running a code marathon,Keep your test simple and petite. Break it into logical units, achieving one goal at a time. Overcrowding your test with multiple assertions isn't a great idea though.  pic courtesy: https://www.intelliware.com

3) Do not automate every test case: Automation is used to cover the regression scenarios to save time on redundant manual testing, the very idea of automating the new features even before the manual testing isn't recommended. Automation cannot compete with manual testing when it comes to creativity and number of bugs that can be reported. But of-course it reduces the redundant effort(that is what automation meant for). Always prioritise your test cases; before getting into actual coding. By doing so you will be clear on what should be achieved by when.

One should not set the goal of automating everything under the sun, its not a great idea for multiple reasons , good test cases for automation are the scenarios which require huge data or actions that needs to be performed multiple times.

4) DO not leverage on COPY-PASTE I have come across multiple instances when automation testers leverage the power of copy paste, do no copy paste same set of code in multiple locations. When there are certain actions which needs to be performed multiple times, its recommended to have a separate class/method and its reused by passing relevant parameters .Its good to have a Utility class which comes handy.

5) Inefficient coding practices = Bad testing practices In my team, we always had this hot topic for discussion "Difference between a good code and efficient code". Well, my definition would be a good code is the one which religiously follow structured coding, documentation, maintainability etc and an efficient code is good code+less number of code lines, runs faster, reliable, non-volatile store etc

We usually land up coding exactly the way we run the application manually, make sure you have optimised manual steps that goes into code, and you are well aware of what's going into the code.By doing so you are well aware of what is your target to achieve and what best possible way you can take to achieve it.

6) Cowboy mindset : Cowboy attitude basically means the programmer/s having autonomy over the coding practice.The attitude of "Lets do whatever we want"is the root cause of flaky code and frequent test failures.Ever since the agile process is followed in development teams the cowboy attitude of resolving things is masked under the name of agile. Have a well defined set of process for any task , stick to the process defined and this will help the whole team to be on track.

Having a well defined process and pathway to walk in-order to achieve the desired goal increases the probability of success. 

 

要查看或添加评论,请登录

Sowmya Sridharamurthy的更多文章

  • Pa11y &Pa11y-CI for accessibility

    Pa11y &Pa11y-CI for accessibility

    Almost all products and service organizations are bringing on their A-Game in their online presence. Not a single day…

  • Deal with Interim compromise- "Technical Debt"

    Deal with Interim compromise- "Technical Debt"

    When the development team is stuck between handling odds and ends or maximizing the product value by adding new…

  • Tips to build an effective team

    Tips to build an effective team

    Every manager's dream would be to build an effective team. However, such teams don’t come out of blue, they have to be…

    2 条评论
  • Say 'NO' to extraneous scenarios in automation

    Say 'NO' to extraneous scenarios in automation

    Automate Automate Automate!! The new crazy mantra of every software tester. The aura of automation creates a mirage of…

  • Know your Game !

    Know your Game !

    Software Testing demands meticulous planning and careful execution, trust me its no less than a strategic game. Quality…

  • Most Popular Node.js Automation Frameworks

    Most Popular Node.js Automation Frameworks

    Test Automation has been around since 25+ years , it has gone through an amazing metamorphosis maturing and stabilising…

    1 条评论
  • What keeps you relevant?

    What keeps you relevant?

    "Be different, but be relevant" Today if I catechize - 'who can be tester's?' probably there will be no specific…

  • In'Sure' Assurance

    In'Sure' Assurance

    Quality assurance is not just defect management or test management, trust me its much beyond that.Quality is a brand in…

    5 条评论
  • Clarity brings Quality

    Clarity brings Quality

    When it comes to software development it’s a well known fact that we cannot achieve flawless product. We all strive to…

    2 条评论
  • Adopting 5'S' for successful Test case maintenance

    Adopting 5'S' for successful Test case maintenance

    5’S’ sounds familiar? Yes ! It is one of the buzz words in lean development methodology. 5’S’is one among the several…

    2 条评论

社区洞察

其他会员也浏览了