Many times there is a requirement in the test step to move to a specific link, keyword, etc. So, we have two methods through which we can directly scroll to the desired element. The two methods are as follows:
The above two methods perform scrolling on the first scrollView present on the UI only.
Lets suppose there is a requirement to scroll to the "Like" link and press enter. Also, if the screen contains more than one "Like" link then scrollTo("Like") method will move the control over the first "Like" text present on the screen.
If there is a requirement to scroll over the exact match to the string then we use scrollToExact(String text) method. Lets suppose there are 4 "Like" link and one "Like(s)" link on a screen and we want to scroll to "Like(s)" link then we use scrollToExact("Like(s)") method.