How to make find robust - another example
I am testing a Visual Studio plug-in, and want to make sure a debug session stops at the correct location. What I am finding is that if I do NOT sRegion.
# look for source tab and make sure it has focus
if not exists(
status = 0
else:
tab = Region(
# set the source view to the expected break line
# narrow down search region
sRegion = tab.below()
# sRegion may not contain where we really want to search; blame MS Visual Studio
# making region wider
oldX = sRegion.getX()
newX = oldX - 200
oldW = sRegion.getW()
newW = oldW + 400
# confirms that I've got the right search region
# look for the line number in sRegion
# this works if I do the above highlight, but gets a wrong match if I don't
# Image is just white background and blue number 103
# looking for the text "103" seems to get the wrong match, too
sLine = sRegion.
if not sLine:
else:
# just making sure I got the right line
# codeRegion is in the source code view
# arrowRegion is where VS displays the Next Statement arrow
# just making sure I made the regions the right size
if not arrowRegion.
if not codeRegion.
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: