← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #161652]: How to check text box is having content or not??

 

Question #161652 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/161652

RaiMan proposed the following answer:
If the entry field is empty, the returned match of
find(blank_textbox.png) should have a score of nearly or exactly 1.0.

If the entry field contains some text, it depends on the
blank_textbox.png, but if it succeeds, it should have a score markedly
below 0.9.

So you can use the match's score to distinguish the 2 situations.

example (to be translated to correct Java ;-)

Match m = s.find("blank_textbox.png")
if m.getScore() > 0.95 # textbox empty
else: # textbox filled

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.