在appium2.0之前,在移动端设备上的触屏操作,单手指触屏和多手指触屏分别是由TouchAction类,Multiaction类实现的。
在appium2.0之后,这2个方法将会被舍弃。
"[Deprecated] 'TouchAction' action is deprecated. Please use W3C actions instead."
![](https://img-blog.csdnimg.cn/img_convert/6c4666023f3e31a305298a249789efa7.png)
728 x 1661529 x 349
1、w3c action是什么?
在w3c的actions当中,将输入源分为了三类:
键盘类 - Key
指针类 - Pointer
None
对于Pointer指针类输入源,共有3种:Mouse鼠标、Touch触屏、Pen笔触
输入源,是提供输入事件的虚拟设备。
每一个输入源,都是一个输入id,输入源type。与真实设备一样,每一个输入源都有状态的,有输入事件。
在python selenium的源码当中,selenium/common/actions/input_devices.py里InputDevices类定义了输入源类。
![](https://img-blog.csdnimg.cn/img_convert/60dbc623c0b64e42fbd45575c57f7166.png)
728 x 3321383 x 630
1、空输入源(null input source)
提供以下行为:
pause:不做任何操作一段时间,或者动作的持续时间
2、键盘输入源(key input source)
提供以下行为:
KeyDown:按下某个键
KeyUp:释放某个键
在python selenium的源码当中,selenium/common/actions/key_input.py里KeyInput类定义了按钮输入源类。