嗯,还是把自己做的实验保存一下
Appium1.12.1+python2.7 实验滚动,查找屏幕外控件以及控制seekbar
scroll() 是根据页面中两个元素位置之间的距离进行滑动。
滑动寻找屏幕外的特定元素,Python可以用find_element_by_android_uiautomator('Uiautomator-Java代码语句'),会上下都滚动一次,遍历一遍。
运行环境:Ubuntu18.0, Appium-linux-1.12.1.AppImage, Python2.7
使用的平板,在settings中测试滚动查找控件
test_scroll:
1.将“家长监护”滚动至原本“显示”所在的位置
2.滚动查找屏幕外的“辅助功能”
test_seekBar
3.控制“显示”功能调节亮度的seekBar,通过坐标滑动(代码中坐标,X坐标从控件宽度取值,因为等于屏幕宽所以才这样取)
#coding=utf-8
'''
Created on 2019年8月31日
@author: derik
'''
import unittest
from appium import webdriver
from selenium.webdriver.common.by import By
class Test(unittest.TestCase):
def setUp(self):
desired_caps={}
# 测试设备的系统版本,adb shell getprop | grep ro.build.version
desired_caps['platformVersion']='5.1.1'
desired_caps['platformName']='Android'
desired_caps['
Appium Python实践:滚动查找与seekbar控制

本文记录了使用Appium 1.12.1和Python 2.7进行滚动操作及查找屏幕外控件的实验,包括如何滚动到目标元素和控制seekbar调整亮度。在Ubuntu 18.0环境中,通过`scroll()`方法和`find_element_by_android_uiautomator`定位元素,实现屏幕滚动和辅助功能查找。同时,展示了如何通过坐标控制seekbar滑动。
最低0.47元/天 解锁文章
557





