# 元素操作介绍
# WEB 操作方法
# 元素操作
| 操作名称 | 说明 | 需要的参数 |
|---|---|---|
| w_click | 元素单击 | { "locating": "" } |
| w_click_upload_files | 点击并选择文件上传 | { "locating": "", "file_path": "" } |
| w_dblclick | 元素双击 | { "locating": "" } |
| w_download | 下载文件 | { "locating": "", "save_path": "" } |
| w_drag_down_pixel | 往下拖动N个像素 | { "locating": "", "n": "" } |
| w_drag_left_pixel | 往左拖动N个像素 | { "locating": "", "n": "" } |
| w_drag_right_pixel | 往右拖动N个像素 | { "locating": "", "n": "" } |
| w_drag_to | 拖动A元素到达B | { "locating1": "", "locating2": "" } |
| w_drag_up_pixel | 往上拖动N个像素 | { "locating": "", "n": "" } |
| w_force_click | 强制单击 | { "locating": "" } |
| w_get_text | 获取元素文本 | { "locating": "", "set_cache_key": "" } |
| w_input | 元素输入 | { "locating": "", "input_value": "" } |
| w_time_click | 循环点击N秒 | { "locating": "", "n": "" } |
| w_upload_files | 拖拽文件上传 | { "locating": "", "file_path": "" } |
# 输入设备操作
| 操作名称 | 说明 | 需要的参数 |
|---|---|---|
| w_hover | 鼠标悬停 | { "locating": "" } |
| w_keyboard_delete_text | 删除光标左侧的字符 | { "count": "" } |
| w_keyboard_insert_text | 直接输入文字 | { "text": "" } |
| w_keyboard_type_text | 模拟输入文字 | { "text": "" } |
| w_keys | 模拟按下指定的键 | { "keyboard": "" } |
| w_mouse_center | 移动鼠标到浏览器中间 | {} |
| w_mouse_click | 鼠标点击坐标 | { "x": "", "y": "" } |
| w_wheel | 鼠标上下滚动像素,负数代表向上 | { "y": "" } |
# 浏览器操作
| 操作名称 | 说明 | 需要的参数 |
|---|---|---|
| w_alert | 设置弹窗不予处理 | {} |
| w_ele_screenshot | 元素截图 | { "locating": "", "path": "" } |
| w_get_cookie | 测试-获取storage_state保存到logs目录 | {} |
| w_goto | 打开URL | { "url": "" } |
| w_screenshot | 整个页面截图 | { "path": "", "full_page": "" } |
| w_set_cookie | 设置storage_state(cookie) | { "storage_state": "" } |
| w_wait_for_timeout | 强制等待 | { "_time": "" } |
# 页面操作
| 操作名称 | 说明 | 需要的参数 |
|---|---|---|
| open_new_tab_and_switch | 点击并打开新页签 | { "locating": "" } |
| w_close_current_tab | 关闭当前页签 | {} |
| w_switch_tabs | 切换页签 | { "individual": "" } |
# 定制开发
| 操作名称 | 说明 | 需要的参数 |
|---|---|---|
| w_click_right_coordinate | CDP定开-总和坐标点击 | { "locating": "" } |
| w_list_input | DESK定开-列表输入 | { "locating": "", "input_list_value": "", "element_loc": "" } |
# 安卓 操作方法
# 应用操作
| 操作名称 | 说明 | 需要的参数 |
|---|---|---|
| a_app_stop_all | 停止所有app | {} |
| a_app_stop_appoint | 停止除指定app外所有app | { "package_name_list": "" } |
| a_clear_app | 清除app数据 | { "package_name": "" } |
| a_close_app | 关闭应用 | { "package_name": "" } |
| a_start_app | 启动应用 | { "package_name": "" } |
# 元素操作
| 操作名称 | 说明 | 需要的参数 |
|---|---|---|
| a_clear_text | 清空输入框 | { "locating": "" } |
| a_click | 元素单击 | { "locating": "" } |
| a_click_coord | 坐标单击 | { "x": "", "y": "" } |
| a_double_click | 元素双击 | { "locating": "" } |
| a_double_click_coord | 坐标双击 | { "x": "", "y": "" } |
| a_drag_to_coord | 拖动元素到坐标上 | { "locating": "", "x": "", "y": "" } |
| a_drag_to_ele | 拖动A元素到达B元素上 | { "locating": "", "locating2": "" } |
| a_element_screenshot | 元素截图 | { "locating": "", "path": "" } |
| a_get_center | 提取元素坐标 | { "locating": "", "x_key": "", "y_key": "" } |
| a_get_text | 获取元素文本 | { "locating": "", "set_cache_key": "" } |
| a_input | 单击输入 | { "locating": "", "text": "" } |
| a_long_click | 长按元素 | { "locating": "", "time_": "" } |
| a_pinch_in | 元素缩小 | { "locating": "" } |
| a_pinch_out | 元素放大 | { "locating": "" } |
| a_set_text | 设置文本 | { "locating": "", "text": "" } |
| a_swipe_ele | 元素内向下滑动 | { "locating": "" } |
| a_swipe_left | 元素内向左滑动 | { "locating": "" } |
| a_swipe_right | 元素内向右滑动 | { "locating": "" } |
| a_swipe_up | 元素内向上滑动 | { "locating": "" } |
| a_wait | 等待元素出现 | { "locating": "", "time_": "" } |
| a_wait_gone | 等待元素消失 | { "locating": "", "time_": "" } |
# 设备操作
| 操作名称 | 说明 | 需要的参数 |
|---|---|---|
| a_get_window_size | 提取屏幕尺寸 | {} |
| a_press_back | 按back键 | {} |
| a_press_camera | 按camera键 | {} |
| a_press_center | 按center键 | {} |
| a_press_delete | 按delete键 | {} |
| a_press_down | 按down键 | {} |
| a_press_enter | 按enter键 | {} |
| a_press_home | 按home键 | {} |
| a_press_left | 按left键 | {} |
| a_press_menu | 按menu键 | {} |
| a_press_power | 按power键 | {} |
| a_press_recent | 按recent键 | {} |
| a_press_right | 按right键 | {} |
| a_press_search | 按search键 | {} |
| a_press_up | 按up键 | {} |
| a_press_volume_down | 按volume_down键 | {} |
| a_press_volume_mute | 按volume_mute键 | {} |
| a_press_volume_up | 按volume_up键 | {} |
| a_pull | 提取文件-未测试 | { "feli_path": "", "catalogue": "" } |
| a_push | 推送一个文件-未测试 | { "feli_path": "", "catalogue": "" } |
| a_screen_off | 关闭屏幕 | {} |
| a_screen_on | 打开屏幕 | {} |
| a_sleep | 强制等待 | { "time_": "" } |
| a_swipe_left | 获取屏幕开关状态 | {} |
| a_unlock | 解锁屏幕 | {} |
# 页面操作
| 操作名称 | 说明 | 需要的参数 |
|---|---|---|
| a_drag | 坐标拖动 | { "sx": "", "sy": "", "ex": "", "ey": "" } |
| a_dump_hierarchy | 获取转储的内容 | {} |
| a_freeze_rotation | 冻结旋转 | {} |
| a_freeze_rotation_false | 取消冻结旋转 | {} |
| a_long_click | 长按屏幕3秒 | { "x": "", "y": "", "time_": "" } |
| a_open_notification | 打开通知 | {} |
| a_open_quick_settings | 打开快速设置 | {} |
| a_screenshot | 屏幕截图 | { "filepath": "" } |
| a_set_orientation_left | 设置为natural | {} |
| a_set_orientation_natural | 设置为natural | {} |
| a_set_orientation_right | 设置为right | {} |
| a_set_orientation_upsidedown | 设置为upsidedown | {} |
| a_swipe | 坐标滑动 | { "sx": "", "sy": "", "ex": "", "ey": "" } |
| a_swipe_down | 下滑 | {} |
| a_swipe_left | 左滑 | {} |
| a_swipe_right | 右滑 | {} |
| a_swipe_up | 上滑 | {} |