Question about including piece of testing code

5 posts, 0 answers
  1. veri555999
    veri555999 avatar
    13 posts
    Member since:
    Sep 2015

    Posted 24 Sep 2015 Link to this post

    Hi, hospital form guy here

    Situation: every hospital form has the same header which uses the same piece of code for testing. I currently have 2 form tests written. Problem is, the same code is copy-pasted in both tests. If I want to make changes to the header code, I have to change it in every test, which is not very convenient.


    Situation that would be useful:

    1. Launch test

    2. Test includes the header code and tests it.

    3. Test continues running its test-specific code.

     

    How could I achieve this? Thank you in advance.

  2. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 25 Sep 2015 Link to this post

    Hello,

    Are you using the free Telerik Testing Framework or our commercial Test Studio product?
    1. In Test Studio you should put the common steps into a sub test then call it from a parent test using Test-as-step.
    2. Using Telerik Testing Framework the principle is the same but you use standard programming methods to create a common method that both tests would call as a subroutine.


    Regards,
    Cody
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  3. veri555999
    veri555999 avatar
    13 posts
    Member since:
    Sep 2015

    Posted 28 Sep 2015 in reply to Cody Link to this post

    Sorry for forgetting to mention. I'm using the TTF with VS2013.
  4. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 28 Sep 2015 Link to this post

    Hi,

    In that case option 2 that I previously explained is the route you must take.

    Regards,
    Cody
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  5. veri555999
    veri555999 avatar
    13 posts
    Member since:
    Sep 2015

    Posted 15 Oct 2015 in reply to Cody Link to this post

    Hi again.

    So, the shared code has been split into several files and is called when needed.

    Case closed!

Back to Top