I'm attempting to create a keyword test to validate a web application. The application requires scrolling to see all of the visible webpage, and complete a form. How can I insert a scroll into the keyword test? TC can't read the scroll bar as a object. Thank you.
Solved! Go to Solution.
"ScrollIntoView" is a method usually available on objects when scripting. Not sure if/how you use it in keyword tests though?
And Chrome has a "MouseWheel" method you could use on the Page object to cause it to scroll. Although I don't know how you'd determine the accuracy - ie. how you'd know when your desired object was in view?
Start Loop Look for Object Object Found/visible? Yes - Exit Loop No - Small scroll via mousewheel End Loop
I'm not a programmer, which is why I'm attempting to use keyword testing.
Regarding the MouseWheel, if I knew scrolling down 6x got the bottom of the page, maybe I could use that?
Actually you don't need to scroll web page to fill the form, because if some input element is presented on the web page, it should be visible for TestComplete.
If the object required is off the page and not visible, you do sometimes need to activate scrolling of some sort to get to it. (In scripting, ScrollIntoView pretty much always does the trick)
Using 6x MouseWheel (it needs a parameter to tell it to scroll up or down) will bring it into view, that will work. But if the page is capable of changing so that extra stuff appears meaning you need 8x, you'll have problems. Hence the scroll, check, scroll again loop.
If I was to use the 'ScrollIntoView' method, would the proper syntax be: