testingseleniumtestcasesource

How can adjust test scripts in selenium when user interface changes constantly?


We recently ran in to a problem.Our team has automated test scripts with selenium. Now we got change request in User Interface, So we have modified the css.

The issue is automated test scripts are not working. we know this is due to css change.

My question is :

What is the best approach to handle those scenarios effectively?


Solution

  • It is the biggest inconvenience of testing... When something is changed, you have to rewrite your test script.

    You can choose the best way of elements localisation for you. But there is always risk that xPath (and CSS or locators of any other type) will be changed. In fact, you can't write script for all possibilities. You just have to change manually your script when there are any changes in app.

    This is a fact which you are not able to avoid.