Forum Discussion

EvgenyTitov's avatar
EvgenyTitov
Occasional Contributor
8 years ago

driver.DoReleaseMouse(driver.GetMouseCursorPositionOnScreen()) does not work.

I use in test command to click on control :

driver.PerformActionWithParametersSequence(controlNode, null, "Click", "Click on " + Description, width - 8, height/2);

Then i am trying to release the Click because when it pushed control closes. Is there any other way to release mouse click? 

TC 9.3.1

Eventually it comes to this function, that don't work:

public void DoReleaseMouse(Point mousePoint)
{
       Connect.LLPlayer["MouseUp"](LeftMouseButton, mousePoint.X, mousePoint.Y, 500);
}

  • Marsha_R's avatar
    Marsha_R
    Icon for Champion Level 3 rankChampion Level 3

    Try recording a test that does the click combination that you want and see what TestComplete gives you for an action.

    • EvgenyTitov's avatar
      EvgenyTitov
      Occasional Contributor

      It appears as a click . But it seems like mouse left button held down. It is not performs as click and release

       

      Set panel = Aliases.PortalAppletHost.PmsApplicationForm.PmsSceneManager.CTVSlabScene.leftPanel.pmsToolPanelMain.pmsTabControl.backgroundPanel.blueStripBackgroundPanel.blueStripPanel
      Set vlabel = panel.Label
      Call vlabel.Click(107, 9)
      Call vlabel.Click(143, 3)
      Call vlabel.Click(143, 3)
      Call vlabel.Click(143, 3)
      Set panel2 = panel.blueStripAdornmentPanel
      Call panel2.Click(5, 5)
      Call panel2.Click(5, 5)

  • EvgenyTitov's avatar
    EvgenyTitov
    Occasional Contributor

    Recorded some KeyWord test and Low Level test + adding Tree of mapped object.

     

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Well.... my initial idea is this...

         

        ... why are we working with a low level player to click on a control?  It would be helpful to understand the full context of what is being attempted.  

         

        Technically speaking, the code is correct with regards to calling the "MouseUp".

         

        For that matter... I see the function declaration as "public void"... and that tells me that this is NOT necessarily being written in TestComplete itself.  Am I correct in assuming this is being written as part of a connected application and we're writing code in something like C# or something to use TC via COM?

         

        So... honestly... I'm a bit confused as to what's going on here so I don't have a whole lot of input.

  • cunderw's avatar
    cunderw
    Community Hero

    I'll second what tristaanogre has said. This does not look like Test Complete code, and there isn't a lot of information about what's happening vs what you expect to happen, or how you're trying to do it. 

  • EvgenyTitov's avatar
    EvgenyTitov
    Occasional Contributor

    Hi, I use TC driver in C# solution. I have added recorded tests in TC because someone suggested me to this and see what happen.

    • AlexKaras's avatar
      AlexKaras
      Icon for Champion Level 3 rankChampion Level 3

      Hi,

       

      Any real reason to do a complex work instead of just using TC?
      And note, that Connected Applications functionality that you are trying to use, does not exist in the latest versions of TestComplete in favor of TestLeft (https://smartbear.com/product/testleft/overview/). Which means that you are basically do something that cannot evolve or be reused and will need to be redone regardless of whether you will upgrade TC or move to TestLeft.