After appium- empty the contents of the input box, the content will be rolled back once again enter the last two strings

Problem Description

There are two input boxes, the user name and password input box

  • Call set_text method, enter your user name
  • Call set_text method again, enter the password
  • After emptying the contents of a user name input box, the content will once again enter the rollback last two strings

Offending code

    def set_text(self, loc, value, is_clear=False):

        element = self.find_element(*loc)

        if is_clear:

            element.clear()
            element.send_keys(value)

        else:
            
            element.send_keys(value)

Solution:

In elsef add the following code in the branch, the problem is solved

element.clcik()
element.send_keys(value)

Guess you like

Origin www.cnblogs.com/webDepOfQWS/p/11793350.html