Forum Discussion

ChristopheC's avatar
ChristopheC
Contributor
10 years ago

Calling a method with a char parameter

Hello,

 

how to call a method in script with a char parameter with TestComplete 10.60.3387.7 ?

 

The application was developed on QT (version 5.4.0), the object "Sys.Process("se_plage").QtObject("MainWindow").QtObject("centralWidget").QtObject("tabWidget").QtObject("qt_tabwidget_stackedwidget").QtObject("PlagesHoraires").QtObject("graphicsViewPH")" provides access to a method "ProgHebdoBAToListCCO_" as with description "Sub ProgHebdoBAToListCCO_(Param1 as char)".

 

I tried the following code :

 

 

param1 = "02:00"
Sys.Process("se_plage").QtObject("MainWindow").QtObject("centralWidget").QtObject("tabWidget").QtObject("qt_tabwidget_stackedwidget").QtObject("PlagesHoraires").QtObject("graphicsViewPH").ProgHebdoBAToListCCO_(param1)

 

 

I get an error (view attachments).

 

Thank you in advance

  • Hello ChristopheC,

     

    The method ProgHebdoBAToListCCO requires a char as a parameter but as I see, you are trying to pass a string to it.

    param1 = "02:00"

     

    Let me see if that helps.

     

    Regards,

     

    Leandro de Araújo Souza

     

     

  • Hello ChristopheC,

     

    The method ProgHebdoBAToListCCO requires a char as a parameter but as I see, you are trying to pass a string to it.

    param1 = "02:00"

     

    Let me see if that helps.

     

    Regards,

     

    Leandro de Araújo Souza

     

     

    • ChristopheC's avatar
      ChristopheC
      Contributor

      Hello leandroaraujoso,

       

      how to pass a char to the method ProgHebdoBAToListCCO ?

       

      Do I look towards method aqString, aqConvert ?

       

      Thank you in advance

      • leandroaraujoso's avatar
        leandroaraujoso
        Contributor

        Hello ChristopheC,

         

        As I understood by looking at your screenshot, the method expects just 1 character and you are trying to pass into it the value "02:00" (which has 5 characters).

        Let me know if that helps.

         

        Regards,

         

        Leandro de Araújo Souza