Forum Discussion

nlvuppula's avatar
nlvuppula
New Contributor
8 years ago

How to Run Test Complete Hand coded Script

Attached Script i have developed through Name mapping i am not getting any option to run the above script please help me out to solve this issue

5 Replies

  • baxatob's avatar
    baxatob
    Community Hero

    Hi,

     

    What are you doing here -

     

    Sys.Process("C:\Program Files (x86)\Dhanush Infotech\TeleMedicine\TeleMedicineWPF.exe");  

    ?

     

    You can't launch your application using provided command. 

    Sys.Process just refers to the already running process by its name (not by path to the executable file).

     

    Better to add your app's executable file to the TestedApps and then run like:

     

    TestedApps.TeleMedicine.Run();

     

  • Put the cursor inside a function and the "Run" option should become available.

     

    Although, I'm not too sure about your script??? Running it in the state you posted (if that's all there is of it) won't get you very far .....

     

    You are passing in name + PW parameters to the "login" function. But not using them. You're using project variables instead? How are they populated? Or have you hard-coded values into them? Similar with the "BillingInformation" function. Where are the input parameters being populated?

     

    Then you have a bunch of other functions that seem to relate to other "things" you can do.

     

    But you don't have any calls into them? (aka - nothing is running them)

     

    Then it pretty much seems to be entering a bunch of hard-coded data. And selecting a bunch of options based on hard-coded index values (not good!).

     

    And nothing is being checked. Or validated. Or anything really. It's all direct actions on stored controls. Mostly with hard-coded values.

     

    I assume there is more to your script? Or you're just learning? Or both ....

    • nlvuppula's avatar
      nlvuppula
      New Contributor

      Hi Colin

       

      Thanks for Your Response i have developed the Script in functions and now i want to call those functions in the Script where i can call and now can i call these methods please let me i am very new to Test Complete i am learning through smart Bear

       

      I have observed one thing from my Recording and Hand coding When i convert the Recording Steps into Script i am getting the Run option and Routines also loading with Manual Scenario name

       

      When i am Developing hand coding i am not getting Run option and Routines are also not loading in my script Unit

       

      Please help me out on this issue a great thankful in Advance

       

      • joseph_michaud's avatar
        joseph_michaud
        Moderator

        Using the user interface, you can only interactively Run script routines which take no arguments.  In the Code Editor, if you put the cursor in the routine and right-click, only the no-argument routines will have the "Run Current Routine" option enabled.  If you right-click on the script file in the Project Workspace, the Run option is presented only if there are suitable routines in the script file.

         

        function NoArgs() { /* suitable */ }
        function OneArg(arg) { /* not suitable */ }