Appium Data parameterization Login Module

Source: Internet
Author: User
Tags appium

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.