1
1
---
2
- title : " Driver Service Class "
2
+ title : " 驱动服务类 "
3
3
linkTitle : " 服务"
4
4
weight : 3
5
5
---
6
6
7
7
服务类用于管理驱动程序的启动和停止.
8
- They can not be used with a Remote WebDriver session .
8
+ 它们不能与远程 WebDriver 会话一起使用 .
9
9
10
- Service classes allow you to specify information about the driver ,
11
- like location and which port to use .
12
- They also let you specify what arguments get passed
13
- to the command line. Most of the useful arguments are related to logging .
10
+ 服务类允许您指定有关驱动程序的信息 ,
11
+ 诸如位置和要使用的端口 .
12
+ 它们还允许您指定传递哪些参数到命令行.
13
+ 大多数有用的参数都与日志记录有关 .
14
14
15
- ## Default Service instance
15
+ ## 默认服务实例
16
16
17
- To start a driver with a default service instance :
17
+ 使用默认服务实例启动驱动程序 :
18
18
19
19
{{< tabpane text=true >}}
20
20
{{< tab header="Java" >}}
@@ -38,10 +38,12 @@ To start a driver with a default service instance:
38
38
{{< /tab >}}
39
39
{{< /tabpane >}}
40
40
41
- ## Driver location
41
+ ## 驱动程序位置
42
42
43
- ** Note:** If you are using Selenium 4.6 or greater, you shouldn't need to set a driver location.
44
- If you can not update Selenium or have an advanced use case here is how to specify the driver location:
43
+ ** 注意:** 如果您使用的是 Selenium 4.6 或更高版本,
44
+ 则无需设置驱动程序位置.
45
+ 如果您无法更新 Selenium 或有高阶用法需求,
46
+ 以下是指定驱动程序位置的方法:
45
47
46
48
{{< tabpane text=true >}}
47
49
{{< tab header="Java" >}}
@@ -67,9 +69,10 @@ If you can not update Selenium or have an advanced use case here is how to speci
67
69
{{< /tab >}}
68
70
{{< /tabpane >}}
69
71
70
- ## Driver port
72
+ ## 驱动程序端口
71
73
72
- If you want the driver to run on a specific port, you may specify it as follows:
74
+ 如果希望驱动程序在特定端口上运行,
75
+ 您可以在启动时指定端口号, 如下所示:
73
76
74
77
{{< tabpane text=true >}}
75
78
{{< tab header="Java" >}}
@@ -95,10 +98,11 @@ If you want the driver to run on a specific port, you may specify it as follows:
95
98
{{< /tabpane >}}
96
99
97
100
<span id =" setting-log-output " ></span >
98
- ## Logging
101
+ ## 日志
99
102
100
- Logging functionality varies between browsers. Most browsers allow you to
101
- specify location and level of logs. Take a look at the respective browser page:
103
+ 日志记录功能因浏览器而异.
104
+ 大多数浏览器都允许您指定日志的位置和级别.
105
+ 请查看相应的浏览器页面:
102
106
* [ Chrome] ({{< ref "../browsers/chrome#service" >}})
103
107
* [ Edge] ({{< ref "../browsers/edge#service" >}})
104
108
* [ Firefox] ({{< ref "../browsers/firefox#service" >}})
0 commit comments