Forum Discussion

Jack_meng's avatar
Jack_meng
Occasional Contributor
6 years ago
Solved

script hung by a popup (QT descktop application)

the scenario is  my script swich a QT tab component after it switch popup a QT window,  then my sctip is hung by popup,  unless I manually close it, my sctipt run to next line.

 

Is there any way to access the pop or fire a event or somethong I can handle this?

 

Thanks

  • Hi Jack,

     

    > tabControl.setCurrentIndex(index);

    I think that .setCurrentIndex(index) is a native method provided by the tabControl. If my above guess is correct, then the application/method may behave differently when called externally from the test script.

    I would suggest to try not to use control's internal method but switch to some tab via UI actions, like the human user does (i.e. using .Keys() or .Click() method (called asynchroniously)).

    Does it help?

     

4 Replies

    • Jack_meng's avatar
      Jack_meng
      Occasional Contributor

      Hi AlexKaras,

      I tried Runner.CallObjectMethodAsync to fix my issue, but it did not work.

      fake code as below:

       

      //after excute below code, popup a new dialog
      tabControl.setCurrentIndex(index);
      //this line can not excute unless i close popup
      Log.Message('done')

      option 1:   endless loop

       

       


      CallResultObj = Runner.CallObjectMethodAsync(tabControl, "setCurrentIndex", index); //cause endless loop, popup dialog never displays while(! CallResultObj.Completed) { aqUtils.delay(1000); }
      Log.Message('done')

      option 2:  same as before

      //after excute this line, scipt blocked, can not excute Runner.CallObjectMethodAsync.
      tabControl.setCurrentIndex(2); CallResultObj = Runner.CallObjectMethodAsync(popupControl, "Close"); while(! CallResultObj.Completed) { aqUtils.delay(1000); } Log.Message('done')

      Please fix me,  How to change my script?

       

      Regards,
      Jack

       

       

       

       

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi Jack,

         

        > tabControl.setCurrentIndex(index);

        I think that .setCurrentIndex(index) is a native method provided by the tabControl. If my above guess is correct, then the application/method may behave differently when called externally from the test script.

        I would suggest to try not to use control's internal method but switch to some tab via UI actions, like the human user does (i.e. using .Keys() or .Click() method (called asynchroniously)).

        Does it help?