三、Appium-python-UI自动化之元素定位uiautomatorviewer
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                三、Appium-python-UI自动化之元素定位uiautomatorviewer
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                uiautomatorviewer是android-sdk自帶的一個元素定位工具,非常簡單好用,使用uiautomatorviewer,可以檢查一個應用的UI來查看應用的布局和組件以及相關的屬性。
?
一、運行uiautomatorviewer.bat
1.打開F:\Android\android-sdk\tools,雙擊uiautomatorviewer.bat
2.點擊devices screenshot,保持手機桌面高亮顯示
3.點擊圖中的元素,右下角即可顯示元素的屬性
4.根據圖中元素
text:? ? ?媽媽保暖長款圓領
resource-id :? com.taobao.taobao:id/home_searchedit
class:? ? ? ? ? ? android.widget.EditText
?
腳本如下:
|  #!/usr/bin/python # -*- coding: utf-8 -*- from appium import webdriver import time desired_caps={ 'platformName':'Android', 'deviceName':'51f58e20', 'platformVersion':'6.0', #apk包名 'appPackage':'com.taobao.taobao', #apk的launcherActivity 'appActivity':'com.taobao.tao.welcome.Welcome' } driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',desired_caps) time.sleep driver.find_element_by_id("com.taobao.taobao:id/home_searchedit").click()  | 
轉載于:https://www.cnblogs.com/chushujin/p/9901453.html
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的三、Appium-python-UI自动化之元素定位uiautomatorviewer的全部內容,希望文章能夠幫你解決所遇到的問題。
                            
                        - 上一篇: Linux CenOS Python3
 - 下一篇: c++入门之——const在函数名前面和