1

I build a test automation framework with selenium for my large sitecore application.

Everything was ok until the content editors started changing stuff around, item names and so on.

I kept updating my smoke test all over again and again!

The Smoke test goes through the pages and checks if they are active, looks for some necessary details, footnotes, social tags and so on.

Maybe my approach is all wrong, would you give me any suggestion?

2 Answers 2

2

It is a common problem almost all front end tester face.

Root cause of this problem is:

  • Developers / content editors make changes without considering how those changes will affect front end testing framework.

It is unrealistic to ask developers / content editors to NOT make any changes at all, so is it possible for you to:

  • get hold of them and request them to keep element IDs consistent and unique? If an element does not have any ID, assign one to it.

  • If they agree to do so, modify your selenium test cases to locate an element via IDs, in this way, your test framework will be less vulnerable when elements' other attributes (xpath, classname and etc) change.
  • If it can not be done, (which is possible) you will have to make do, e.g. introduce more abstraction in your locating methods.
3
  • Well my problem is with content editors, they even changed the navigation links, and thought maybe should be some mechanism that could loop through the sitecore root directory and could identify the items that are navigation links somehow! But thanks on your explaining, really appreciate your opinion since I was thinking the same thing, you just proof my point
    – Challenger
    Commented Dec 14, 2017 at 13:54
  • dynamically checking that links found are valid is a valid approach. Validating that they should be there at all in the content is a different subject and requires better co-ordination with the changers and the testers. Commented Dec 14, 2017 at 23:55
  • + 1 for asking for IDs suggestion. Commented Dec 15, 2017 at 10:10
0

I solved this by optimizing my selenium selectors to be less specific. This meant that they could tolerate a lot more changes to the structure of the pages, and adding and removing content, divs and so on. My goal became to minimize how specific the selectors were. This made a big difference in the maintenance effort. I used tools like Firepath to achieve this.

Another technique is to create a small testing section of the website that is not visible to users. Authors, editors and developers are less likely to change this, so it makes your tests more stable.

1
  • Rich , could you please share your few optimizing changes which made your framework more tolerant of content changes? Commented Dec 15, 2017 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.