Forum Discussion

e_lock's avatar
e_lock
Occasional Contributor
11 years ago

VisibleOnScreen changes immediately after point and fix

Hi all,



I am trialling TestComplete atm and have a question.  When I try to identify an object via point and fix TC finds the object and VisibleOnScreen is set to True.  If I then immediately after I have done this try to highlight the object it can't find it and I can see that VisibleOnScreen is set to False, despite nothing having changed.



The parent of the object in question is a Smart PropertyGrid.net which I can identify fine.  It has various child objects, such as PropInPlaceTextBox or PropInPlaceLists, and it is these which I am struggling with.  Smart PropertyGrid is made by VisualHint, but I think our development team have further customised it.  I have tried mapping the Smart PropertyGrid to the MS PropertyGrid but it hasn't helped.  The Smart PropertyGrid is dynamic, but I have identified that without a problem.



Hope someone can help,

Ellie

7 Replies

  • e_lock's avatar
    e_lock
    Occasional Contributor
    We solved this by writing a new method within the application to return the coordinates of the control we need, and then firing a click at it.
  • e_lock's avatar
    e_lock
    Occasional Contributor
    I've been playing about with it a little further, and it seems that if I first click on that part of the grid, in the label section, then it can find the field.  Problem is, SmartBear can't identify that part of the grid, only the editble section....  The only way I can think of is by graphical automation, but if I have to do that I might as well search for the field itself.  I've attached a screenshot of the grid in question to give you an idea of what I'm talking about.
  • e_lock's avatar
    e_lock
    Occasional Contributor
    I was wondering, is there a way that I could put a code snippet in before each attempted operation, which would set focus to the grid row of the current object?  I'm thinking perhaps that I need to make this datadriven, so that I have an excel spreadsheet of the objects I'm expecting in this particular propertygrid, and I can just loop through them, setting the focus for each one and then validating it.  I want to keep the solution as code free as possible so that any tester can use it though, so one routine which just pulled the object from the data source and set the focus would be ideal.  Does that sound possible?
  • e_lock's avatar
    e_lock
    Occasional Contributor
    Well, in lieu of any other responses - it seems that what I want to do isn't possible.  Smart PropertyGrid only shows one inplace control at a time and there is no way to change that.  The only way to get a handle a control is by clicking on it - and we can't click on it until we have got a handle to it....  I have tried a coded solution and so far have not been able to make it work.  I'm not sure if it's the same with the standard MS PropertyGrid.net - but if anyone has any ideas - feel free to let me know!
  • ananddave123's avatar
    ananddave123
    Occasional Contributor
    you can click the row by the label name of the row. for example :

     Call propertyGridControl.ClickValue("Description")

    as for the second row of your image provided






  • e_lock's avatar
    e_lock
    Occasional Contributor
    My issue seems to be a limitation with VisualHint's Smart PropertyGrid.  The labels are being built dynamically using reflexion to interrogate the components on the screen.  This obviously helps with performance, but means that it is either not possible, or I don't have the knowledge to be able to get a handle to them.  If I was able to do this, I could click on the label and thus activate that row and get a handle to the field control.



    <sigh>