oTree Forum >

Bot Error!

#1 by AJafarzadeh

Once I run the test for my app, the below error is appeared. Could you please to solve this problem? 
 "Bot expects to be on page DecisionKlee but current page is /p/iy51bmc0/kk2/ChatKlee/16"
 In the chatklee page time out happens so, there is no next buttons to go to the next page. it goes after some minutes automatically. 
 my test code is as follows: 
 class PlayerBot(Bot):

    def play_round(self):
        e = randint(1, 5)
        f = randint(1, 5)

        if self.player.round_number == 1:
            if self.participant.group == 'klee':
                yield GuideKlee
                yield GuideKandinsky

        if self.participant.group == 'klee':
            yield Submission(ChatKlee, check_html=False, timeout_happened=True)
            if self.participant.klee_quiz == True:
                yield Submission(DecisionKlee, dict(klee_quiz=e), check_html=False)
            yield Submission(ChatKandinsky, check_html=False, timeout_happened=True)
            if self.participant.kandinsky_quiz == True:
                yield Submission(DecisionKandinsky, dict(kandinsky_quiz=f), check_html=False)

#2 by Evan_Calford

I'm not sure that this is best practice, and there is probably a much better solution, but when I run into similar issues with bots I insert a next button onto all pages. Then, after I have finished the bot testing, I remove the next buttons again.

Write a reply

Set forum username