(·12 |webdriver/remote分析)
1 源码路径
selenium/webdriver/remote
2 功能说明
方法 | 描述 | 说明 |
---|---|---|
command.py |
Defines constants for the standard WebDriver commands |
定义标准WebDriver命令的常量 |
errorhandler.py |
Error codes defined in the WebDriver wire protocol |
WebDriver wire协议中定义的错误代码 |
file_detector.py |
Used for identifying whether a sequence of chars represents the path to a file |
用于标识字符序列是否表示文件的路径 |
getAttribute.js |
/ | 获取属性 |
isDisplayed.js |
/ | 判断元素是否显示 |
mobile.py |
/ | 定义移动端的功能 |
remote_connection.py |
A connection with the Remote WebDriver server |
与远程WebDriver服务器的连接 |
switch_to.py |
/ | 切换能力 |
utils.py |
/ | 辅助能力 |
webdriver.py |
The WebDriver implementation |
定义webdriver核心API |
WebElement.py |
Represents a DOM element |
定义对webdriver element操作的能力 |
3 部分功能详解
3.1 command.py
-
定义标准WebDriver命令的常量;
-
如下:
-
比如我们常用的(部分):
常量 | 值 |
---|---|
CLOSE |
close |
QUIT |
quit |
GET |
get |
REFRESH |
refresh |
GET_COOKIE |
getCookie |
FIND_ELEMENT |
findElement |
FIND_ELEMENTS |
findElements |
GET_TITLE |
getTitle |
SCREENSHOT |
screenshot |
SET_TIMEOUTS |
setTimeouts |
MAXIMIZE_WINDOW |
windowMaximize |
MINIMIZE_WINDOW |
minimizeWindow |
-
Alerts相关常量
-
Advanced user interactions常量
-
Screen Orientation常量
-
Touch Actions常量
-
HTML 5常量
-
Mobile常量
3.2 errorhandler.py
- WebDriver wire协议中定义的错误代码
- 如下:
- 代码说明:
代码 | 标识 | 说明 |
---|---|---|
0 |
SUCCESS |
成功 |
7 |
NO_SUCH_ELEMENT |
no such element |
8 |
NO_SUCH_FRAME |
no such frame |
9 |
UNKNOWN_COMMAND |
unknown command |
10 |
STALE_ELEMENT_REFERENCE |
stale element reference |
11 |
ELEMENT_NOT_VISIBLE |
element not visible |
12 |
INVALID_ELEMENT_STATE |
invalid element state |
13 |
UNKNOWN_ERROR |
unknown error |
15 |
ELEMENT_IS_NOT_SELECTABLE |
element not selectable |
17 |
JAVASCRIPT_ERROR |
javascript error |
19 |
XPATH_LOOKUP_ERROR |
invalid selector |
21 |
TIMEOUT |
timeout |
23 |
NO_SUCH_WINDOW |
no such window |
24 |
INVALID_COOKIE_DOMAIN |
invalid cookie domain |
25 |
UNABLE_TO_SET_COOKIE |
unable to set cookie |
26 |
UNEXPECTED_ALERT_OPEN |
unexpected alert open |
27 |
NO_ALERT_OPEN |
no such alert |
28 |
SCRIPT_TIMEOUT |
script timeout |
29 |
INVALID_ELEMENT_COORDINATES |
invalid element coordinates |
30 |
IME_NOT_AVAILABLE |
ime not available |
31 |
IME_ENGINE_ACTIVATION_FAILED |
ime engine activation failed |
32 |
INVALID_SELECTOR |
invalid selector |
33 |
SESSION_NOT_CREATED |
session not created |
34 |
MOVE_TARGET_OUT_OF_BOUNDS |
move target out of bounds |
51 |
INVALID_XPATH_SELECTOR |
invalid selector |
52 |
INVALID_XPATH_SELECTOR_RETURN_TYPER |
invalid selector |
60 |
ELEMENT_NOT_INTERACTABLE |
element not interactable |
/ | INSECURE_CERTIFICATE |
insecure certificate |
61 |
INVALID_ARGUMENT |
invalid argument |
/ | INVALID_COORDINATES |
invalid coordinates |
/ | INVALID_SESSION_ID |
invalid session id |
62 |
NO_SUCH_COOKIE |
no such cookie |
63 |
UNABLE_TO_CAPTURE_SCREEN |
unable to capture screen |
64 |
ELEMENT_CLICK_INTERCEPTED |
element click intercepted |
/ | UNKNOWN_METHOD |
unknown method exception |
405 |
METHOD_NOT_ALLOWED |
unsupported operation |
文章版权声明
1 原创文章作者:7762,如若转载,请注明出处: https://www.52hwl.com/38241.html
2 温馨提示:软件侵权请联系469472785#qq.com(三天内删除相关链接)资源失效请留言反馈
3 下载提示:如遇蓝奏云无法访问,请修改lanzous(把s修改成x)
4 免责声明:本站为个人博客,所有软件信息均来自网络 修改版软件,加群广告提示为修改者自留,非本站信息,注意鉴别