Forum Discussion

ponder6168's avatar
ponder6168
Visitor
6 years ago

Using TestComplete Scripts with LoadNinja

We are looking to purchase an automated UI testing tool and a load testing tool but we would like to use the scripts we develop for the UI testing tool with the load testing tool.  Is that possible with TestComplete and LoadNinja?

  • Hi,

     

    No, this is not possible according to my knowledge. And, actually, not needed.

    TestComplete is a GUI functional testing tool. This means that test code in TestComplete does a lot of things to verify that tested application works and looks as required from the end-user point of view. Actions may include direct queries to database, long waits until all page script code completes processing, image comparisons, etc. Functional test code is usually slow and this is OK and expected.

    LoadNinja is a web load testing tool, which means that it must generate plain web traffic (send requests and wait for responses) and monitor that status code for responses corresponds to expected and that responses are received within the expected time frame. As a rule, load tests do not contain complex business logic because of performance considerations.

    Load testing must be planned in advance according to the actual (or planned/expected) users' activity scenarios.

    For example, your web site, according to the statistic obtained from the log, may have 85% of users just browsing, 10% of users will put 1-5 items into the basket and dismiss of and only 5% of users will complete the purchase.

    According to the above scenario, you will need to record three scripts in LoadNinja: fist script that will browse for some product; second one that will put the product into the basket and third one that will proceed to the end of the purchase. Then you might want to parameterize recorded scripts so that they: a) browse for a random product (from some predefined list); and b) browse for some random number of products before quitting the browser.

    Then you must set the load scenario to match your usage statistics. I.e., for example, for 100 virtual users (VUs), assign 85 VUs to the first script, 10 to the second and 5 to the third one and run load test.

    Note, that load test should not perform complex business logic. For example, it should not check that the price has been discounted for 5% (and calculate the value) if the user entered coupon code. Such verifications must be done in functional tests (in TestComplete). In load testing you must follow straight non-branching ways. Again, if only 10% of your real users apply coupon code, then record two scripts - one with and another without applying for discount. Assing 10% of VUs to the first one and the rest to the second and run load test.

    The goal of the load test is to check how tested web server behaves under load, but not correctness of the business logic.

     

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    No, this is not possible according to my knowledge. And, actually, not needed.

    TestComplete is a GUI functional testing tool. This means that test code in TestComplete does a lot of things to verify that tested application works and looks as required from the end-user point of view. Actions may include direct queries to database, long waits until all page script code completes processing, image comparisons, etc. Functional test code is usually slow and this is OK and expected.

    LoadNinja is a web load testing tool, which means that it must generate plain web traffic (send requests and wait for responses) and monitor that status code for responses corresponds to expected and that responses are received within the expected time frame. As a rule, load tests do not contain complex business logic because of performance considerations.

    Load testing must be planned in advance according to the actual (or planned/expected) users' activity scenarios.

    For example, your web site, according to the statistic obtained from the log, may have 85% of users just browsing, 10% of users will put 1-5 items into the basket and dismiss of and only 5% of users will complete the purchase.

    According to the above scenario, you will need to record three scripts in LoadNinja: fist script that will browse for some product; second one that will put the product into the basket and third one that will proceed to the end of the purchase. Then you might want to parameterize recorded scripts so that they: a) browse for a random product (from some predefined list); and b) browse for some random number of products before quitting the browser.

    Then you must set the load scenario to match your usage statistics. I.e., for example, for 100 virtual users (VUs), assign 85 VUs to the first script, 10 to the second and 5 to the third one and run load test.

    Note, that load test should not perform complex business logic. For example, it should not check that the price has been discounted for 5% (and calculate the value) if the user entered coupon code. Such verifications must be done in functional tests (in TestComplete). In load testing you must follow straight non-branching ways. Again, if only 10% of your real users apply coupon code, then record two scripts - one with and another without applying for discount. Assing 10% of VUs to the first one and the rest to the second and run load test.

    The goal of the load test is to check how tested web server behaves under load, but not correctness of the business logic.