VisibleOnScreen is True when web object is not clickable
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
VisibleOnScreen is True when web object is not clickable
I am using TestComplete 12, and some of my web tests are failing now due to the VisibleOnScreen property value being True when the web object (Panel or TextNode) is partially visible but not clickable and not able to set focus. This is happening in both Chrome and Firefox browsers, latest versions.
Is this a known issue to be fixed? Previously, I could safely check VisibleOnScreen to determine if the web object could be clicked.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
VisibleOnScreen is precisely that... it determines whether or not the object is visible on screen. I think you may have just lucked out in the past for using whether or not it is "Enabled". Try the "Enabled" property to see if it's clickable.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The objects are indeed Enabled, Visible and VisibleOnScreen, although only partially and cannot accept a focus when I manually do a roll-over.
I was going by the TestComplete Documentation, which indicates in the Remarks it could be used for visible controls that accept mouse clicks:
Remarks
•The VisibleOnScreen property returns true, if a control or its part is on screen and can accept mouse clicks. For example, focused controls whose opacity is set to 0 are absolutely transparent (that is, invisible), but their VisibleOnScreen property will return true.
•The VisibleOnScreen property is always false for disabled Silverlight controls.
After more investigation, this appears to only happen in Chrome and not FireFox, so I am wondering if perhaps it's an issue with Chrome or that TC extension?
Thanks for trying to help me out, I am puzzled and haven't found a work-around yet for my web app.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Might have something to do with the TC extension. Unfortunately, I'm running TC 10.6 so I don't have the latest and greatest so I can't check that out for you. I know Chrome recently updated to version 51 so it's possible something MIGHT be out of date.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sounds like a bug to me. I'd raise a support ticket. Chrome is bad for this sort of thing. Most of the browser handling issues I've run into have been with Chrome.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With my TC V11, I 've encountered the same behaviour: .visileOnScreen gives me false positives, so it is not reliable and I can't use it. What I tried to do is to check whether a control is available for clicking, and whether a given Dialog is active.
As a Workaround, and even as a real improvement, I now use the OnOverlappingWindow-Callback.
As a result, my scripts can just click any control available, regardless whether the Dialog is on top or not. Background dialogs are activated automatically, Messageboxes are closed, thus simplifying Scripting.
That's the way to do it:
- implement the OnOverlappingWindow-Callback
- lead all .Click/.ClickButton/.ClickItem etc. -Actions to a common clickHandling function.
- In this function, set any additional context You may Need for the callback.
- In the Callback, You evaluate the standard and additional context and e.g. activate the desired Dialog or Close disturbing messageboxes. Then Your set a result context.
- Afterwards, in the clickHandling function, You check the result context and react and do logging.
Really works fine!
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for this information, it is very helpful!
I believe I can use this in other situations which are fragile to make them more robust, such as a fixed banner bar which overlaps underlying links and ScrollIntoView cannot be relied on.
I appreciate the detail, I should be able implement this based on your steps.
Many thanks!
