#the wait delay of .5 seconds is not applied to the the while loop
with rDispSchemeList:
while not exists(pDispSchemeScrollBarBottom):
try: rDispSchemeList.click(pImage) type(Key.ENTER)
break
except FindFailed: type(Key.DOWN)
#however, in the following example, it is and the whole block runs much faster
while not rDispSchemeList.exists(pDispSchemeScrollBarBottom):
try: rDispSchemeList.click(pImage) type(Key.ENTER)
break
except FindFailed: type(Key.DOWN)
I have found that when using the with keyword with a region, it does not always apply to the statements beneath.
For example, in the following code
def dispSchemeListR egion(sTestId, iDelay) : sTestId, pDispScreenTitl eBar)
match = findLog(
if(match): reg.offset( 463,429) )
x = match.getX()
y = match.getY()
else:
exit(0)
reg = Region(x,y,483,217)
rDispSchemeList = Region(
rDispScheme List.setAutoWai tTimeout( iDelay)
return rDispSchemeList
------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- egion(sTestId, 0.5)
rDispSchemeList = dispSchemeListR
#the wait delay of .5 seconds is not applied to the the while loop
with rDispSchemeList: pDispSchemeScro llBarBottom) :
rDispSche meList. click(pImage)
type( Key.ENTER)
type( Key.DOWN)
while not exists(
try:
break
except FindFailed:
#however, in the following example, it is and the whole block runs much faster
while not rDispSchemeList .exists( pDispSchemeScro llBarBottom) :
rDispSchemeLis t.click( pImage)
type(Key. ENTER)
type(Key. DOWN)
try:
break
except FindFailed: