Am I running test cases efficiently? - a newbie question

Hi all

I have been using Jet Brains Intellij for a while now just to practice and learn and hopefully get an automated role soon. but, I wanted someones honest opinion.
My problem is, Iam having problems organising my test cases. I feels like I am doing a lot of work to automate something. For example, if you take the Santander.co.uk website and if I were to automate the ā€œcurrent account tabā€. But then within this, has more then 10 links. So if I were to automate those links, I would have to go into Intellij, create 10 separate test cases just for those link.
Does this sound efficient to anyone? I remember when I did my Selenium Java class last year, we group tests together such as the login page. But I feel like theres going to be slight variations of these test cases as well.
Iam just using Intellij, GIT and the Maven Repository in the.pom file. And thats it.
Please someone help me :frowning:

Hey mazza,

So, Iā€™m new to the field, but Iā€™ll give you some advice thatā€™ll hopefully help you nevertheless.

In my experience so far, you want to limit the amount of UI/Functional/User Story tests you do. The main reason for this is that these types of test tend to take the most amount of time to perform, and can commonly be quite ā€˜flakeyā€™, as they usually rely on waiting for certain elements to load in order to run.
Because of this, you generally want to aim to have as few of these kind of tests as possible, and you want these tests to focus on the most common tasks you expect your users to perform.
You then want to make sure that you have a lot of unit tests, and slightly less integration tests. If you have a research of the ā€˜testing pyramidā€™ youā€™ll see it basically says the same thing.
Ultimately, take all of this with a grain of salt, as itā€™s not like hard and fast rules or anything. But testing absolutely everything on a page using Selenium is generally going to be inefficient, and may be relatively fragile.
One thing you can look into to help with testing UI pages like this is the concept of PageObjects, but ultimately, this wonā€™t completely mitigate the above issues.

If youā€™re interested in learning how to do unit tests, you can also take a look at codewars.com, as thereā€™s loads of good katas on there thatā€™ll help you learn Java, and also encourage you to write tests for the code you write.

One final thing Iā€™d also recommend is that you look into learning Cypress.io as well. Thereā€™s a training course recently released on Test Automation University that Iā€™m sure youā€™d find useful.

2 Likes

Hi there,

It is hard to be specific with such a general topic. In general I would suggest your GUI testing to be limited to the bare minimum as there are more stable and faster ways to test business logic than through the GUI. So try to figure out a few customer behaviors, rate them by importance and implement those.
As a few examples: Place an Order, Search for a Product.

BDD has good patterns on how to reason regarding these scenarios.

Good luck

1 Like