Forum Stats

  • 3,752,074 Users
  • 2,250,455 Discussions
  • 7,867,708 Comments

Discussions

Click action issue with java access bridge in Python

User_ILBOQ
User_ILBOQ Member Posts: 1 Green Ribbon

I manage to get description or name from some controls in java applet with jab, and also the click action runs successfully. The java applet needs some time to respond to click action, after the click action, sometimes the python script continues to run remaining lines, but sometimes it will crash and close with no error message. In below codes, I want to set text content to a textbox and click on a button for 5 times, unfortunately it always crashes after the first round.

One point add here, I find that when I manually click on some button on that applet while below codes is running, or when the click action is post and the applet itself will do some reponses, at this point below codes will always stop running.

list_test = [1,2,3,4,5]

for num in list_test:
#set text, this works well
        Textbox.setTextContents(num)
        TempNum = Textbox.getAccessibleTextItems(index = 0).word
        if TempNum != num:
                print('input error')
        print('input finished')

#click on button,works well in the first round.
        getAccessibleActions = button.getAccessibleActions()
        aa = button.doAccessibleActions(getAccessibleActions)
        if aa == 0:
                print('click failure')
    print('click' finished)

Answers