- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
46).closeclose(self): Closes the current window. 关闭当前窗口 :Usage: driver.close() 47.quitquit(self): Quits the driver and closes every associated window. 退出脚本运行并关闭每个相关的窗口连接 :Usage: driver.quit() 48.driver.get_screeshot_as_file 截屏函数 driver.get_screenshot_as_file(文件路径+文件名) ? driver.get_screenshot_as_file(c:/error_png.png) ????? * * * * * * * * * * * * * * * * * * 14. hide_keyboardhide_keyboard(self, key_name=None, key=None, strategy=None): Hides the software keyboard on the device. In iOS, use `key_name` to press a particular key, or `strategy`. In Android, no parameters are used. 隐藏键盘,iOS使用key_name隐藏,安卓不使用参数 ? :Args: - key_name - key to press - strategy - strategy for closing the keyboard (e.g., `tapOutside`) driver.hide_keyboard() 15. keyeventkeyevent(self, keycode, metastate=None): Sends a keycode to the device. Android only. Possible keycodes can be found in /reference/android/view/KeyEvent.html. 发送按键码(安卓仅有),按键码可以上网址中找到 :Args: - keycode - the keycode to be sent to the device - metastate - meta information about the keycode being sent 用法 dr.keyevent(‘4’) 16).current_activitycurrent_activity(self): Retrieves the current activity on the device. 获取当前的activity 用法 print(driver.current_activity()) 17)wait_activitywait_activity(self, activity, timeout, interval=1): Wait for an activity: block until target activity presents or time out. This is an Android-only method. 等待指定的activity出现直到超时,interval为扫描间隔1秒 即每隔几秒获取一次当前的activity 返回的True 或 False :Agrs: - activity - target activity - timeout - max wait time, in seconds - interval - sleep interval between retries, in seconds 用法driver.wait_activity(‘.activity.xxx’,5,2) 18)background_app background_app(self, seconds): Puts the application in the background on the device for a certain duration. 后台运行app多少秒 :Args: - seconds - the duration for the application to remain in the background 用法 driver.background_
文档评论(0)