先按住这个radio_info_view,才展示另外一个B,id,我需要将radio_info_view拖入b位置,试了好几种方法都不行。
最终将屏幕宽高得到后,计算出出现b位置的框高,h是b位置的最顶部高度,hh是b位置的底部高度,w是b位置的最左,www是b位置的最右
最后塞入
TouchAction(driver).long_press(radio_info_view).wait(2000).move_to(x=w&www, y=h&hh).wait(1000).release().perform()
完成拖拽
#以下是代码:
radio_info_view = driver.find_element_by_id('radio_info_view')
#定位到需要按住的点
s = driver.get_window_size()
myprint(s)
#取出来size
myprint("获取driver宽和高:%s" % s)
h = ceil(s["height"]/1.01)
#算出来最后需要拖入位置的上高
hh = s["height"]
#下高
www = s["width"]
#右x
w = 0
#左x
myprint(h,hh,w,www)
#TouchAction(driver).long_press(radio_info_view).wait(2000).move_to(x=0.1080, y=2000.2030).wait(1000).release().perform()
TouchAction(driver).long_press(radio_info_view).wait(2000).move_to(x=w&www, y=h&hh).wait(1000).release().perform()
time.sleep(4)
screenshots(driver, 81)