← Back to team overview

sikuli-driver team mailing list archive

[Question #253057]: Send random text everytime on chat screen

 

New question #253057 on Sikuli:
https://answers.launchpad.net/sikuli/+question/253057

class chatting:
    def chat1(self,chatmsg1):
        if exists("person1.png"):
            type(chatmsg1)
        else:
            click("person1.png")
            while not exists("person1.png",0):
                wait(1)
            wait(2)    
            type(Key.TAB * 2)
            type(chatmsg1 + Key.ENTER)
            wait(2)


    def chat2(self,chatmsg2):
        if exists("person2.png"):
            type(chatmsg2)
        else:
            click("person2.png")
            while not exists("person2.png",0):
                wait(1)
            type(Key.TAB * 5)
            type(chatmsg2 + Key.ENTER)
            wait(2)
    
#comres  (Common resource)
chatmsg1 = ''.join(random.sample(string.letters, num1))
chatmsg2 = ''.join(random.sample(string.letters, num2))


#Calling
chatting.chat1(comres.chatmsg1)
chatting.chat2(comres.chatmsg2)


Every time it is sending the same text. Is anything wrong in this code.Please help 



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