Here is the Python login code I recently learned:
classTest (object):defGetdic (self): D= {'username':' -','Password':'1111'} returndprinttest=test () UserInfo=printtest.getdic ()PrintUserInfo forKey, ValueinchUserinfo.items ():PrintKey, ValuePrintuserinfo.values ()PrintUserinfo.keys ()
Result: {' username ': ' + ', ' password ': ' 1111 '}
Username 13
Password 1111
[' 13 ', ' 1111 ']
[' username ', ' password ']
Inside the main use of the knowledge of the dictionary, limited to login to a user;
This method is not applicable if you want to verify the test cases that are logged in by the user in a variety of situations, here is another way I summarize:
Using the simulation test data of List
For user in Loginlist:
Logininfo.login (User[0], user[1])
This is to get the value of each user and password,
You can choose different methods to get the user name and password according to different situations.
Appium Data parameterization Login Module