- Public method with parameter of type RepoItemInfo
- Verify if the input argument exists
- Convert RepoItemInfo to Adapter (throwException false, existence of repo item validated in previous step)
- While loop - keep going up/down (page up/down) until the element is visible, then click on the element
To ensure smooth functionality I highly recommend applying EnsureVisible() Invoke Action on the appropriate list of elements.
Code: Select all
public void Scroll(RepoItemInfo repoInfoElement){
if (repoInfoElement != null){
Ranorex.Unknown itemAdapter = repoInfoElement.CreateAdapter<Ranorex.Unknown>(false);
do {Keyboard.Press("{Next}");
} while (itemAdapter.Visible == false);
itemAdapter.Click();
}
}
Code: Select all
public void Scroll(RepoItemInfo repoInfoElement, string Directon){
if (repoInfoElement != null){
Ranorex.Unknown itemAdapter = repoInfoElement.CreateAdapter<Ranorex.Unknown>(false);
do {
switch(Directon)
{
case "up" :
Keyboard.Press("{PageUp}");
break;
case "down" :
Keyboard.Press("{Next}");
break;
}
} while (itemAdapter.Visible == false);
itemAdapter.Click();
}
}