← 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

    Status: Open => Answered

Calle Rundgren proposed the following answer:
answer = input("do you want to replace an existing username?")    #first ask about what to do
userName = input("input your username")   
if answer == "yes":                                                  #in case answer is yes
    find("blank_textbox.png")                                     #find the location of the textbox
    click(getLastMatch())                                        #click latest found match (textbox)
    type("a", Key.CTRL)                             #highlight the text in textbox (if there is any)
    paste(userName)                                 #paste the username.
if answer == "no":
    type(Key.ENTER)                                 #press enter to logon (or whatever you want do)

Is it something liek this you are looking for?

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