3 edited title
| link

How to set up seleiumselenium tests so that if one fails, the others still run?

2 edited title
| link

Need help with my test structure How to set up seleium tests so that if one fails, the others still run?

1
source | link

Need help with my test structure

To give some context I am building a testing system with Selenium, nUnit and Visual Studio in c# that will allow me to test a number of websites one after another.

The issue I have is that all of the tests are stored in separate classes and are called one after another. This works great, but if any tests are to fail all of the other tests following them will not be executed.

I tried to work around this by using a verify instead of an assert, this does work but any data about the failure is not shown.

In an ideal situation, the Site A tests would run one after another, if any tests are to fail it would store that data and continue with the next test until it reaches the last test and will start the tests for Site B.

Below is an example of how I call the tests:

    [Test]
    public void Tests()
    {
        foreach (var baseURL in baseURLS)
        {
            // Frontend Failed login
            var Frontend_FailedLogin = new UseCases.Frontend_Tests.Account.Frontend_FailedLogin(this._driver, baseURL);
            Frontend_FailedLogin.FailedLogin();

            // Frontend Login test
            var Frontend_Login = new UseCases.Frontend_Tests.Account.Frontend_Login(this._driver, baseURL);
            Frontend_Login.Login();
        }
     }

Does anyone have any suggestions on how to handle this? The main issue is that I need to run these tests one after another but still be able to see what tests have failed.

I am pretty new to this so please excuse my lack of knowledge on the subject.