Browser does not intercept the control of the mouse

4 posts, 0 answers
  1. Max
    Max avatar
    4 posts
    Member since:
    Dec 2016

    Posted 09 Apr 2017 Link to this post

    During the test, the browser does not intercept the control of the mouse. The browser opens, navigation to the page occurs, text fields are filled in, but the element is not clicked. The mouse cursor does not even go into the browser. In this case, no error occurs, the framework thinks that the click has happened. The problem only appeared after the transition from 2016.3.928.0 to 2017.1.0329
  2. Elena
    Admin
    Elena avatar
    1152 posts

    Posted 12 Apr 2017 Link to this post

    Hello Max,

    Thanks for contacting us. 

    As far as I understand you are automating a Silverlight application using the Telerik Testing Framework. Please correct me if this assumption is not correct. 

    From the description of the observed issue I guess that the click needs to be simulated as real user behavior. What is the code you have used to perform the click? Please if give a try to use the Desktop Manager Class in case you haven't already. 

    I hope to hear from you soon! 

    Regards,
    Elena Tsvetkova
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Max
    Max avatar
    4 posts
    Member since:
    Dec 2016

    Posted 08 Jan 2018 in reply to Elena Link to this post

    Hello. Thanks for the answer.
    The above problem is no longer relevant, however, a similar problem has appeared.

    The problem is floating. When I call method Click() from ArtOfTest.WebAii.Silverlight.UserInteraction, the cursor is hovered over the element, but it does not click. I looked in the source and found the next implementation.

    public void Click(MouseClickType clickType)
            {
                int width = 0;
                if ((NativeMethods.User32.GetWindowLong(this._element.Application.ContentWindow.Handle, -20) & 4194304) != 0)
                {
                    NativeMethods.RECT rECT = new NativeMethods.RECT();
                    NativeMethods.User32.GetWindowRect(this._element.Application.ContentWindow.Handle, ref rECT);
                    width -= rECT.Width;
                }
                this.Click(clickType, new Point(width, 0), OffsetReference.AbsoluteCenter);
            }

    When I replaced method Click() to Click(MouseClickType.LeftClick, 0, 0, OffsetReference.AbsoluteCenter), the error disappeared.

    Probably parameter "width" is incorrectly calculated.
    Please, can describe how method Click(MouseClickType clickType) should work and what are these magic numbers?
    Thank you.

  4. Elena
    Admin
    Elena avatar
    1152 posts

    Posted 11 Jan 2018 Link to this post

    Hello Max,

    Thanks for getting back. 

    Depending on the application specifics you might need to apply a click method with extended arguments as you have tried that yourself already. Without access to the application under test and the exact code used I could not determine what the reason could be for the observed failure. 

    Here you could find all Click methods exposed along with the arguments they require. I hope this will be helpful to you. 

    Thank you! 

    Regards,
    Elena Tsvetkova
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top