Mobile: Unable to call test from other test

4 posts, 0 answers
  1. Rob
    Rob avatar
    2 posts
    Member since:
    Jul 2019

    Posted 28 Aug Link to this post

    Hello

     

    I'm trying to call a test from another test in Mobile Test Studio.  The only indicated way is through a coded step.  Below is the code inside the test method.  The test returns a -1 exit code.

    I have called the separate test from the command line directly so know it's possible to call a test, but not sure if this is capable in Mobile Test Studio.

    //Code Start
     // initialize new system process
            Process runFooTest = new Process();
            // define the process name to be started
            runFooTest.StartInfo.FileName = @"C:\Program Files (x86)\Progress\Test Studio\Bin\MobileStudio\Telerik.MobileTesting.Runner.exe";

            // set the arguments
            runFooTest.StartInfo.Arguments = @"/msgServer=ws://localhost:8083 /project=C:\MobileAutomation\Mobile /test=Successful_Connection_iOS_App";

            // run the process
            runFooTest.Start();

            // wait until the test return an exit code
            runFooTest.WaitForExit();

            // get the exit code from the executed process 
            int exitCode = runFooTest.ExitCode;

    //Log.WriteLine(exitCode.ToString());

            // check if this test step pass or fail. If return 0 - process complete normally, else - process fould.
            Assert.AreEqual(exitCode, 0);

  2. Elena
    Admin
    Elena avatar
    1155 posts

    Posted 30 Aug Link to this post

    Hi Rob,

    Thank you for sharing details of the current scenario you need to cover. 

    You are correct that the executing a mobile test as step is not an out-of-the-box feature in a mobile project and the only approach you can go for is within a coded step. This kind of limitation is because of the specifics of running the tests on a mobile device - and what I mean by specifics is the way the mobile applications are being started for the test automation. 

    Having that said, it will be important to sort out what is the exact scenario for executing a mobile test from within another mobile test. Possibly, the coded step should work, if the test called from the coded step should run against different application. Otherwise, if it should run against the same app, it may be not started in the desired state. 

    So to be able to find out what could possibly go wrong, there will be some additional details required to analyze the case. Thus, I will appreciate if you can go through the below topics and share your input on these: 
    - what is supposed the test called from the coded step to do? 
    - does it start a new application on the device? 
    - when you execute the coded step, what is being executed on the device? 
    - do you see the target application starting at all? 
    - if yes, does it start in the desired state? 
    - any further details related to the coded step execution will be helpful for us to identify what could be causing the failing exit code. 

    In addition to all of these, I noticed that in the command listed in the coded step there is a missing file extension for the test - as per the documentation the /test argument should contain the file extension like this: 

    /test=Successful_Connection_iOS_App.mttest

    I am not sure if this will change the misbehavior you observe. However, if this is not the missing piece and you need additional assistance, I will be looking forward to hearing back from you more about the requested details. 

    Thank you in advance for your time and cooperation. 

    Regards,
    Elena
    Progress Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  3. Rob
    Rob avatar
    2 posts
    Member since:
    Jul 2019

    Posted 03 Sep in reply to Elena Link to this post

    Thanks for the reply, I've added the file extension you suggested but unfortunately the result appears to be the same. I've attached a screen shot of the error message I'm receiving.

    - The test called from the coded step is supposed to open an app, tap a text field, and input "hello world."
    - It does start a new application on the device.
    - See attached screenshot.
    - The target application does start, but immediately closes after opening. 
    - The target app is starting in the desired state.
  4. Elena
    Admin
    Elena avatar
    1155 posts

    Posted 09 Sep Link to this post

    Hello Rob,

    Please, excuse us for the delayed reply and thanks for providing the requested details.  

    I have to admit that there is no 'test as step' concept in Test Studio Mobile - although you can simulate such behavior within a coded step, there is no implementation for such nested test execution and result handling. There is a feature request on the topic logged on our feedback portal - here you can find it and vote for it to increase its importance as of customer perspective. 

    Still ,I wanted to have the details about the scenario to possibly find any workaround on the case. However, the last suggestion I can share, will be to use the test list feature in the mobile testing module and divide the different action flows in separate tests. Then order these tests in the test list and execute it.

    I hope this will be helpful for you to cover the requirements you have. Of course, if there is anything else I can be helpful with, please, let me know. 

    Regards,
    Elena
    Progress Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top