Forum Discussion

MW_Didata's avatar
MW_Didata
Regular Contributor
2 years ago

Can you clickbutton asynchronously

so for my test I have to either click button or press F12 (both do the same). TC then wait for completion but I need it to press another tested app to actually finish.

After about a minute the transaction times out and then TC can continue. I don't want it to timeout of course I need TC to press or click and be able to continue with the next few steps. how would one do this?

 

My project is in .vbs

So how do i get TC to click the button without waiting for it to finish?

  • I tried Keys methode and the code works 

    Sub Press_Keys
      Dim Obj, Result
      Set Obj = Aliases.etc.etc.frmOrders
      Set Result = Runner.CallObjectMethodAsync(Obj, "Keys", "[F12]")
    End Sub

     

    But TC still get stuck in endless loop.

    The action is waiting for a response, but TC has to give the response in another tested app.

     

    EDIT: This worked but it takes a long timke for TC to go to the next step.

    • MW_Didata's avatar
      MW_Didata
      Regular Contributor

      I'm reading all the pages but can't wrap my head around it.

      Right now I have this:

      Sub Click_button
        Dim Obj, Result
        Obj = Aliases.etc.etc.pnlAfrekenButtons.btnOk
        Set Result = Runner.CallObjectMethodAsync(Obj, Clickbutton)
      End Sub

       

      the error I get says wrong parameter.

      Line 4 column 3

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    Sub Click_button
      Dim Obj, Result
      Set Obj = Aliases.etc.etc.pnlAfrekenButtons.btnOk
      Set Result = Runner.CallObjectMethodAsync(Obj, Clickbutton)
    End Sub

     

    Gives me this error:

    The Async_Click - Click_button routine expects a different number of parameters
    What parameters am i missing?
     
    EDIT: My bad i tried parameterizing Obj, and removed it but not from my keywordtest, please ignore this reply
  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I can't test the code until I get my new license key for TC!

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    I tried Keys methode and the code works 

    Sub Press_Keys
      Dim Obj, Result
      Set Obj = Aliases.etc.etc.frmOrders
      Set Result = Runner.CallObjectMethodAsync(Obj, "Keys", "[F12]")
    End Sub

     

    But TC still get stuck in endless loop.

    The action is waiting for a response, but TC has to give the response in another tested app.

     

    EDIT: This worked but it takes a long timke for TC to go to the next step.