defpress_keycode(self, keycode:int, metastate: Optional[int]=None, flags: Optional[int]=None)->'WebDriver':"""Sends a keycode to the device.Android only. Possible keycodes can be foundin http://developer.android.com/reference/android/view/KeyEvent.html.Args:keycode: the keycode to be sent to the devicemetastate: meta information about the keycode being sentflags: the set of key event flagsReturns:Union['WebDriver', 'Keyboard']: Self instance"""ext_name ='mobile: pressKey'args ={'keycode': keycode}if metastate isnotNone:args['metastate']= metastateif flags isnotNone:args['flags']= flagstry:self.assert_extension_exists(ext_name).execute_script(ext_name, args)except UnknownMethodException:# TODO: Remove the fallbackself.mark_extension_absence(ext_name).execute(Command.PRESS_KEYCODE, args)return cast('WebDriver', self)
defswipe(self, start_x:int, start_y:int, end_x:int, end_y:int, duration:int=0)->'WebDriver':"""Swipe from one point to another point, for an optional duration.Args:start_x: x-coordinate at which to startstart_y: y-coordinate at which to startend_x: x-coordinate at which to stopend_y: y-coordinate at which to stopduration: defines the swipe speed as time taken to swipe from point a to point b, in ms.Usage:driver.swipe(100, 100, 100, 400)Returns:Union['WebDriver', 'ActionHelpers']: Self instance"""touch_input = PointerInput(interaction.POINTER_TOUCH,"touch")actions = ActionChains(self)actions.w3c_actions = ActionBuilder(self, mouse=touch_input)actions.w3c_actions.pointer_action.move_to_location(start_x, start_y)actions.w3c_actions.pointer_action.pointer_down()if duration >0:actions.w3c_actions = ActionBuilder(self, mouse=touch_input, duration=duration)actions.w3c_actions.pointer_action.move_to_location(end_x, end_y)actions.w3c_actions.pointer_action.release()actions.perform()return cast('WebDriver', self)
defscroll(self, origin_el: WebElement, destination_el: WebElement, duration: Optional[int]=None)->'WebDriver':"""Scrolls from one element to anotherArgs:origin_el: the element from which to begin scrolling (center of element)destination_el: the element to scroll to (center of element)duration: defines speed of scroll action when moving from originalEl to destinationEl.Default is600 ms for W3C spec.Usage:driver.scroll(el1, el2)
defdrag_and_drop(self, origin_el: WebElement, destination_el: WebElement)->'WebDriver':"""Drag the origin element to the destination elementArgs:origin_el: the element to dragdestination_el: the element to drag toReturns:Union['WebDriver', 'ActionHelpers']: Self instance"""
from appium.webdriver.common.touch_action import TouchAction
5.1 tap方法
tap()方法模拟手指对某个元素或坐标按下并快速抬起;
使用方法为:
deftap(self,element: Optional['WebElement']=None,x: Optional[int]=None,y: Optional[int]=None,count:int=1,)->'TouchAction':"""Perform a tap action on the elementArgs:element: the element to tapx : x coordinate to tap, relative to the top left corner of the element.y : y coordinate. If y is used, x must also be set,and vice versa
比如:
TouchAction(driver).tap(user_name).perform()
5.2 press方法
press()方法是手指一直按下;
使用方法:
defpress(self,el: Optional['WebElement']=None,x: Optional[int]=None,y: Optional[int]=None,pressure: Optional[float]=None,)->'TouchAction':"""Begin a chain with a press down action at a particular element or pointArgs:el: the element to pressx: x coordiate to press. If y is used, x must also be sety: y coordiate to press. If x is used, y must also be set
比如:
TouchAction(driver).press(x=100, y=200).perform()
5.3 release方法
release()方法是模拟手指抬起;
使用方法:
defrelease(self)->'TouchAction':"""End the action by lifting the pointer off the screenReturns:`TouchAction`: Self instance"""self._add_action('release',{})return self
defmove_to(self, el: Optional['WebElement']=None, x: Optional[int]=None, y: Optional[int]=None)->'TouchAction':"""Move the pointer from the previous point to the element or point specifiedArgs:el: the element to be moved tox: x coordiate to be moved to. If y is used, x must also be sety: y coordiate to be moved to. If x is used, y must also be setReturns:`TouchAction`: Self instance"""
1. 基本问题
收敛阶 lim k → ∞ ∣ e k 1 ∣ ∣ e k ∣ r C > 0 , r 为收敛阶 \lim_{k\to\infty} \frac{|e_{k1}|}{|e_k|}^rC>0 \,\,,\,\, r为收敛阶 k→∞lim∣ek∣∣ek1∣rC>0,r为收敛阶
2. 二分法
二分法是线性收敛的,如果指定精度 …
Studio One mac是一款专业的音乐制作软件,该软件提供了全面的音频编辑和混音功能,包括录制、编曲、合成、采样等多种工具,可用于制作各种类型的音乐,如流行音乐、电子音乐、摇滚乐等。 Studio One mac软件特点 1. 直观易用的界面&…
目录 简介首次用户多功能支持性能表现安全的加密处理进一步阅读 简介
pdfcpu 是一个用 Go 编写的 PDF 处理库。同时它也提供 API 和 CLI。pdfcpu 提供了丰富的 PDF 操作功能,用户还能自己编写配置文件,用来管理和使用各种自定义字体并存储有效的默认配置…
sound control mac可以帮助用户控制某个独立应用程序的音量,通过每应用音量,均衡器,平衡和音频路由独立控制每个应用的音频,还有整个系统的音量。 sound control mac功能亮点
每个应用程序的音量控制 独立控制应用的数量。 键盘音…