Webdriver-based test code daily debug Party Python Chapter

Source: Internet
Author: User
Tags appium

See the forum someone wrote the Java test code of the daily design, to share with you how I usually test the test
The. Code is primarily based on the Python language. Daily debugging based on Webdriver is very handy in Python interactive mode,
Open Python has interactive mode:
Web-side Example:

From selenium import Webdriver
Dr=webdriver. Chrome ()
Dr.get (' http://cn.bing.com ')
dr.find_element_by_id ("Sb_form_q"). Send_keys ("Wo")
dr.find_element_by_id ("Sb_form_q"). Send_keys ("ni")
Python does not need tools to have a natural edge.
Mobile-Appium Instances
From Appium import Webdriver
desired_caps={}
desired_caps["PlatformName"]= "Android"
desired_caps["Platformversion"]= "4.2.2"
desired_caps["DeviceName"]= "192.168.245.101:5555"
desired_caps["Apppackage"]= "Com.android.calculator2"
desired_caps["Appactivity"]= ". Calculator "
Dr=webdriver. Remote ("Http://127.0.0.1:4723/wd/hub,desired_caps")
Dr.find_element_by_name ("1"). Click ()
Dr.find_element_by_name ("5"). Click ()

Webdriver-based test code daily debug Party Python Chapter

Related Article

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.