Forum Discussion

TanIlak's avatar
TanIlak
Contributor
2 years ago

Execution Plan

Hi team,

I am having script with one main function and 2 sub functions that will fetch the table values, while am trying to execute in execution plan in main function got passed but it shows error in sub function as "can't read tBodies property of undefined" and also while in single script execution it will not throw any error.

I have attached image below, how I have created execution plan also, let me know If any other ways to do these into execution plan.

  • Assuming you mean, you don't know how to define the variable in the Execution Plan - 

     

    If you click the area highlighted,

    you will be prompted with another dialog to enter the variable

     

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Assuming you mean, you don't know how to define the variable in the Execution Plan - 

     

    If you click the area highlighted,

    you will be prompted with another dialog to enter the variable

     

  • Kitt's avatar
    Kitt
    Regular Contributor

    Try assigning a value in your Parameters column. IE: ATable (Value = Table1) & ABody (Value = Body1) -- using values you are expecting in your test. See TestComplete reference [here].

    • tvklovesu's avatar
      tvklovesu
      Frequent Contributor

      Not sure why you are using sub child. you can use groups if you want a set of test cases run in a sequence. By using sub child and if one sub child fails, your reports show that all the parent level test cases has failed.

       

      • TanIlak's avatar
        TanIlak
        Contributor

        Hey, I am dragging the script and execute through execution plan it will automatically be creating like child. So, only am trying to create child and sub child. Can you please give me any solution for this issue. Thanks

    • TanIlak's avatar
      TanIlak
      Contributor

      Hi rraghvani,

      The parameters have been defined in parameter execution plan. could you please refer the image I have attached previously and the error where am having is "Can't defined tBodies is undefined" here am fetching the table values.

      >> for (var i = 0; i < ATable.tBodies.length; i++) 

       

       

      And one more question rraghvani single script execution is working fine. why it comes to execution plan I am facing this issue???

       

      Thanks.

      • tvklovesu's avatar
        tvklovesu
        Frequent Contributor

        As rraghvani, mentioned you need to provide parameter value for those scripts. These scripts might run fine when running individually from keyword test script as you might have added the variables within the test script, but this will fail when you run from Execution plan as its sending empty value. if your variable is reading data at runtime and using in your For loop within the test script then you need to create it as variable not as test parameter. Also provide the sample script where you create the ATable and ABody variables.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Looking at your screenshot, (Value = [n\a]) indicates that there's no parameters specified, so it will not work.

     

    Can we see the coding of your "single script", so that we can compare it with the execution plan you have defined?

     

    It's difficult to provide a solution, if you don't provide enough information.