locked
How to set/do the class which should be executed first in coded ui where there exists many classes [CodedUITest] attribute?? RRS feed

  • Question

  • Hello Team,

    I am using vsts 2012 for coded ui automation. I have created coded ui test project and added many coded ui classes- e.g

      [CodedUITest]
        public class A
        {
         }

    [CodedUITest] 

    public class b
        {
         }

    CodedUITest] 

    public class c
        {
         }

    So how can i set class order .....in coded ui test.....i want to run first class c then Class A and then calss B ...........

    I know using ordered test we can set order/sequence of methods to run................

    But can we achieve this for class also...............

    Please help me...........

    Thanks


    Sunday, March 15, 2015 4:55 PM

Answers

  • Hi Mon_bk,

    Thank you for posting in MSDN forum.

    >>So how can i set class order .....in coded ui test.....i want to run first class c then Class A and then calss B ...........

    Generally, I know that we could use this ordered test to call the codedUItest method to according to this specified order by ordered test.

    As you said that you want to set this class order in coded UI test, as far as I know that it is default that we could not implement this function in coded UI test.

    However, I have a replace workaround to run class order for coded UI test. The workaround is that you could try to use such as a console application to execute this coded UI test.

    For example, you could create a console application project and then reference this coded UI test project by Adding Reference.

    And then call this coded UI test class in this Main method, the code like the following.

    using CodedUITestProject1;

    namespace ConsoleApplication1

    {

        class Program

        {

            static void Main(string[] args)

            {

                CodedUITestProject1.CodedUITestC codedC = new CodedUITestProject1.CodedUITestC();     

                codedC.CodedUITestMethodC();

                CodedUITestProject1.CodedUITestA codedA = new CodedUITestProject1.CodedUITestA();

                coded2.CodedUITestMethodA();

                CodedUITestProject1.CodedUITestB codedB = new CodedUITestProject1.CodedUITestB();

                coded3.CodedUITestMethodB();

            }

        }

    }

    So I suggest you could try to refer the above code to check this issue.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Tina-Shi Monday, March 23, 2015 8:21 AM
    Monday, March 16, 2015 8:13 AM