How can we maintain Selenium scripts when the application changes?
Specifically, how do we define and manage automation to keep it up to date with changes in the application being tested?
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It only takes a minute to sign up.Sign up to join this community
To make your selenium scripts work well with a changing product do the following:
H3, etc. Avoid css styling such as
.buttonthat doesn't describe the actual item even if unique on the page in question. Look for a balance between over-specifying which is an issue with pages that change over time or are dynamically generated by a web application framework, and under-specifying which raises the issue of not identifying the fragment uniquely enough.
As if your question is much unclear to me, from my understandings if you are using selenium web driver then there are a lot of automation frameworks available to maintain the selenium scripts. One of them is Page Object Model.
The chief problem with script maintenance is that if 10 different scripts are using the same page element, with any change in that element, you need to change all 10 scripts. This is time consuming and error prone.
A better approach to script maintenance is to create a separate class file which would find web elements, fill them or verify them. This class can be reused in all the scripts using that element. In future if there is change in the web element, we need to make change in just 1 class file and not 10 different scripts.
This approach is called Page Object Model(POM). It helps in making code more readable, maintainable, and reusable.
For more details refer this. Hope it will help you !
The same question has been asked multiple times :
I would suggest you to go through both these links because it has loads of ideas and suggestions people have mentioned as to how you can build a properly maintainable test framework. Also I could think of this particular link , which talks about the principle of DRY (Don't Repeat Yourself) to be particularly apt for your scenario. Please go through it as well.
I think this is asking, "How do I keep my automation up to date with my app?" There is no easy answer to this. There are three possible outcomes when the app changes:
By default, especially when ownership of a test suite is handed off to someone else, no one worries about false negatives. Identifying them required reading and understanding the code.
I have also faced similar issue while writing automation for my project. Test maintenance is one of the important issue while creating automation scripts.
I was looking for some free and open source tool which can develop selenium automation without writing any code and which is easy to maintain.
I didn't find anything which I needed so I've created Almond Automation. It is codeless web automation testing tool.
It provides the below features:
There are other features apart from few mentioned above. Please visit Almond Automation for complete installation and documentation.