0

I have more than 50 UI @Test (unit test using VS 2010) functions that execute using Appium. I have written the test-cases in a sequential way, starting from login and ending with logout.

However, my problem is when I start to execute these test cases, they do not run in the coded sequence. For example, logout can start before login and so it will fail. Is there any way to solve this problem?

Meirion Hughes
  • 21,021
  • 8
  • 65
  • 114
Ibar Deon
  • 1
  • 2

2 Answers2

0

In case you are using TestMethod from visual studio an Ordered Test added to your project shall help you. While using junit or test-ng, one thing good to know is the @Test are supposedly de-coupled and able to execute independently. So the order of execution should not be the concern when you frame your test.

If this be forced by any chance that your method needs an order to execute you can use dependsOnMethod and dependsOnGroup using junit and have an additional capability termed priority in testng. Good reads on this could be found here :

  1. Test methods in order junit

  2. Test methods in order testng

  3. Fix order in junit using RunWith

  4. Ordered test in visual studio

Community
  • 1
  • 1
Naman
  • 23,555
  • 22
  • 173
  • 290
0

The problem solved when I clean the Visual Studio solution and rebuild the project again

Why clean affect Form Jon Skeet answer
Clean solution will remove the build artifacts from the previous build. If there are any other files in the build target directories (bin and obj) they may not be removed, but actual build artifacts are. I've seen behaviour for this vary - sometimes deleting fairly thoroughly and sometimes not - but I'll give VS the benefit of the doubt for the moment :)

Community
  • 1
  • 1
Ibar Deon
  • 1
  • 2