Forum Discussion

ameykhopade's avatar
ameykhopade
Contributor
9 years ago

can i click object if “visibleonscreen” property false even to the object it available on screen

I am using the FullName Of the object from the object spy to perform the click action in TestComplete. However i am not able to preform any action on that object as the VisibleOnScreen property of that object is False, but the object is available on the screen.

if i change the CSS display property in the application code the VisibleOnScreen becomes True and i can get the object highlighted on the screen which was not possible earlier.

Now my question is that is it necessary to that VisibleOnScreen property should be True to perform any action on the object Runtime via automation script or is their any alternative way to click that object runtime even though the VisibleOnScreen property is False. As I have to avoid changes in the application code??

 

why is the visibleonscreen property false even to the object it available on screen and can be clicked manually.

The Object type in CSS is Glaphycon. i even tried to spy the same type of objects onhttp://getbootstrap.com/components/ in IE

how can i perform the click action on these objects in my automation script?

 

so may question is that can i click object if "Visibleonscreen" property is false even when the object is available on the screen and visible and can be clicked manually.

  • nwuser_testcomp's avatar
    nwuser_testcomp
    Occasional Contributor

    Hello,

     

    According to below article “visibleonscreen” property is true only when if a control or its part is on screen and can accept mouse clicks.

    https://support.smartbear.com/viewarticle/85066/

    Below are my queries around this issue-

     

    Are you able to click on the object manually?

    There might be the situation that there is some event being fired in background which makes this object clickable or changes the css property(which you mentioned),so you need to fire that event,you can also talk to the developers.

     

    Cheers!!

    • Colin_McCrae's avatar
      Colin_McCrae
      Community Hero

      CSS (and other rendering code) can manifest all sorts of strange effects depending on what they're using to show/hide items on screen.

       

      If VisibleOnScreen being false prevents you using the Click method directly (does it? Not sure personally ...), but you can otherwise still get the object and all it's properties, I guess you could simply get it's co-ordinates and then use those to apply a click at screen level? Which should do the trick. I have to do something similar with some custom event triggers we have as hotspots within a tree object.

       

      It's not ideal, but it should work.

       

      Of course, this only really holds up if you are certain of visibility (sounds like you are) and all you need to do is apply a simple click on a certain point. If the clicking and interaction is going to get more complex, it gets trickier.

      • ameykhopade's avatar
        ameykhopade
        Contributor

        Yes tried using the co-ordinates but the object is a filter button in the column name and the co-ordinates changes asa soon as the column width changes depending upon the labels in the column.

         

        so the co-ordinates are not fixed

    • ameykhopade's avatar
      ameykhopade
      Contributor

      yup read the article.

       

      again Yes i am able to click the object manually.

      in the attached image i need to perform click action on the filter button next to label name.

       

       

      i am not doing any action before the click action on that object as soon as the page is loaded.