s_bakharev
12 years agoNew Contributor
Clicking a VisibleOnScreen web object (problem)
Hi,
I've been working with TestComplete for testing web pages for several months and when we started testing our scripts with various browsers we found out that TestComplete cannot correctly scroll some panels to bring up the objects that are out of the current screen view. The only browser where this worked fine was IE. In Firefox and Chrome TestComplete scrolls the whole page instead of scrolling the object's container and then the object appears to be overlapped when I try to click it.
Well, I solved that problem (I guess the reason of the problem is in a really sophisticated HTML structure of the web page which I work with) by adding some JScript code for scrolling the objects' containers with Object.MouseWheel procedure but...
I use Object.VisibleOnScreen property to find out whether the object has or has not been scrolled to. And sometimes the object only appears on the screen partially but TestComplete then tries to click on the very center on the object when I call Object.Click and... fails because the center is out the view.
Is there a way to solve this problem? Can I somehow find out whether the object is visible completely?
Using TestComplete 9.20, IE 10, Firefox 20, Chrome 26.
Thanks in advance.
I've been working with TestComplete for testing web pages for several months and when we started testing our scripts with various browsers we found out that TestComplete cannot correctly scroll some panels to bring up the objects that are out of the current screen view. The only browser where this worked fine was IE. In Firefox and Chrome TestComplete scrolls the whole page instead of scrolling the object's container and then the object appears to be overlapped when I try to click it.
Well, I solved that problem (I guess the reason of the problem is in a really sophisticated HTML structure of the web page which I work with) by adding some JScript code for scrolling the objects' containers with Object.MouseWheel procedure but...
I use Object.VisibleOnScreen property to find out whether the object has or has not been scrolled to. And sometimes the object only appears on the screen partially but TestComplete then tries to click on the very center on the object when I call Object.Click and... fails because the center is out the view.
Is there a way to solve this problem? Can I somehow find out whether the object is visible completely?
Using TestComplete 9.20, IE 10, Firefox 20, Chrome 26.
Thanks in advance.
- It seems to be a bug in TestComplete. I think you report it to SmartBear.
Regarding your question, I think you can compare the ScreenLeft, ScreenTop, Width and Height properties of the tested object with the same properties of the parent Page object to check if tested object is completely visible on the screen.