Appium1.6.4-beta iOS Real-computer Python script [1]

Source: Internet
Author: User
Tags python script appium

1th step, learn about Appium service keywords

Document Address: HTTPS://GITHUB.COM/APPIUM/APPIUM/BLOB/MASTER/DOCS/CN/WRITING-RUNNING-APPIUM/CAPS.CN.MD

2nd step, install the appropriate module in Python

1, Appium-python-client

2, Selenium

3rd step, write the script

#-*-Coding:utf-8-*-

From time import sleep

From Selenium import Webdriver

desired_caps={}

desired_caps[' automationname ']= ' xcuitest ' #Xcode8. Above 2 no uiautomation, need to use Xcuitest

desired_caps[' platformname ']= ' IOS '

desired_caps[' platformversion ']= ' 10.2.1 '

desired_caps['devicename']=' iPhone 5 '

desired_caps[' app ']= ' Xxx.app '

desired_caps[' udid ' = ' device Udid '

desired_caps[' Webdriveragenturl ']= ' http://10.1.18.172:8100/' #url为XCTRunner启动后, gives the serverurlhere-> Http://10.1.18.172:8100<-ServerURLHere

Dr = Webdriver. Remote (' Http://127.0.0.1:4723/wd/hub ', desired_caps)

Sleep (5)

Dr.quit ()

4th step, run the script

1. Start W Ebdriveragentrunner in terminal:xcodebuild-project/usr/local/lib/node_modules/appium/node_modules/ Appium-xcuitest-driver/webdriveragent/webdriveragent.xcodeproj-scheme webdriveragentrunner-destination id= Equipment Udid Test

The following content is successful

Test Suite ' All tests ' started at 2017-02-13 14:31:59.322

Test Suite ' Webdriveragentrunner.xctest ' started at 2017-02-13 14:31:59.329

Test Suite ' uitestinguitests ' started at 2017-02-13 14:31:59.333

Test case '-[uitestinguitests Testrunner] ' started.

t = 0.01s Start Test at 2017-02-13 14:31:59.342

t = 0.01s Set up

2. Start appium:appium-a 127.0.0.1-p 4723 in terminal

The following content is the success

[Appium] Welcome to Appium V1.6.4-beta (rev. 70b1c6de0b889aabc86b1990c59994e6acb8d726)

[Appium] non-default Server args:

[Appium] address: ' 127.0.0.1 '

[Appium] Appium REST HTTP interface listener started on 127.0.0.1:4723

3. Run the Python script

Precautions:

Because the Webdriveragentrunner app can only be installed above iOS9, it is necessary to use the IOS9 device to do the real machine test

Appium1.6.4-beta iOS Real-computer Python script [1]

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.