XsiSec Absent Member.
Absent Member.
509 views

how to organize tests in an order

I wonder how do you organise tests in silktest?

 

there are like what I know three different commands:

@before

@after

@test

 

like below:

 

@Before

public void setup()

}

@Test

public void testLogin()

{

}

 

@Test

public void testAgentLookup()

}

 

 

 

how do I organize like 10 tests in a order?

@Test1

 

@Test2

 

@Test3

 

@Test4

 

@Test5



Could someone help me?

 

Thank you in advance

Tags (2)
0 Likes
2 Replies
Highlighted
AndySchott Absent Member.
Absent Member.

RE: how to organize tests in an order

The @Before, @Test, and @After attributes are part of JUnit, not Silk4J. Silk4J uses JUnit as the test runner, so you are free to use any features provided by JUnit to organize your tests.

Based on this Stackoverflow answer, as of JUnit 4.1.1 the @FixMethodOrder attribute can be used to give the tests in the class a specific order. I don't know if that provides enough features to order the tests the way you want, but hopefully it does. If not, I you can read the JUnit documentation to figure out if there is some other way of ordering the tests to run in your desired order.

Andy

XsiSec Absent Member.
Absent Member.

RE: how to organize tests in an order

Thanks for the answer I will take a closer look at Nunit indeed instead of Junit since I have another criteria it need to work together with VSTS (I know Junit doesn't support that well VSTS).

But thanks
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.