how to tell when vertical scroll bar is no longer present
When the window is first displayed, the vertical scroll bar is present. I increase the height of the window until the vertical scroll bar is no longer present. I am using an image of the up arrow on the vertical scroll bar so that I can break out of the loop when the vertical scrollbar is no longer present. In the scenario I am testing, after increasing the window height once, the vertical scroll bar is not present, but the else condition in the loop is not executed as I was expecting. The while loop continues to execute until maxSteps is 0 and then exits the loop instead of breaking out of the loop when maxSteps is 2. I would appreciate some help with getting the code snippet below to work correctly. I have looked at the FAQs. This line of code "if (null != reg.exists(
code snippet:
Screen screen = new Screen();
Region reg;
reg = new Region(screen); //Screen is a region
reg = App.focusedWind
int maxSteps = 3;
int steps = 1;
//increase window height until the vertical scroll bar is no longer present
while (maxSteps > 0){
if (null != reg.exists(
maxSteps -= steps;
}
else
{// arrow image not found; so break out of loop
break;
}
}//end while
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- RaiMan
- Solved:
- Last query:
- Last reply: