Detect a dialog box
Problem: Often times I'm unable to detect images using the wait() or exists() methods. This seems like a really easy problem but I'm consistently having an issue with this. It's different things I'm trying to detect but most often it's a Windows dialog box with text. I've tried a couple solutions (exists and wait, neither yields a greater chance of success):
Solution 1
if exists(image.jpg):
print 'I like cookies'
Solution 2
p = Pattern(
p.similar(.85)
if exists(p):
print 'I like cookies'
These solutions sometimes work but often they don't. I'm not sure why. I've tried taking extremely small images of the dialog box, even just a word from the box. There are no strange backgrounds or colors. It's just black text on a gray background. I've also tried taking screenshots of other things (a PDF) without much success.
Thank you so much for your help.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- tlondon
- Solved:
- Last query:
- Last reply: